diff options
Diffstat (limited to 'js/src/jit-test/tests/debug/Environment-find-03.js')
-rw-r--r-- | js/src/jit-test/tests/debug/Environment-find-03.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/debug/Environment-find-03.js b/js/src/jit-test/tests/debug/Environment-find-03.js new file mode 100644 index 000000000..fd07f603f --- /dev/null +++ b/js/src/jit-test/tests/debug/Environment-find-03.js @@ -0,0 +1,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); |