blob: fd07f603f22ea25028c80473c6b5464dc9a04176 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
// env.find() finds nonenumerable properties in with statements.
var g = newGlobal();
var dbg = Debugger(g);
var hits = 0;
g.h = function () {
var frame = dbg.getNewestFrame();
var target = frame.eval("obj").return;
var env = frame.environment.find("PI");
assertEq(env.object, target);
hits++;
};
g.obj = g.Math;
g.eval("with (obj) h();");
g.eval("with (Math) { let x = 12; h(); }");
g.eval("obj = {};\n" +
"Object.defineProperty(obj, 'PI', {enumerable: false, value: 'Marlowe'});\n" +
"with (obj) h();\n");
assertEq(hits, 3);
|