diff options
Diffstat (limited to 'js/src/jit-test/tests/debug/Environment-getVariable-14.js')
-rw-r--r-- | js/src/jit-test/tests/debug/Environment-getVariable-14.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/debug/Environment-getVariable-14.js b/js/src/jit-test/tests/debug/Environment-getVariable-14.js new file mode 100644 index 000000000..237ea6e1a --- /dev/null +++ b/js/src/jit-test/tests/debug/Environment-getVariable-14.js @@ -0,0 +1,18 @@ +// Debugger.Environment can reflect optimized out function scopes + +var g = newGlobal(); +var dbg = new Debugger; +dbg.addDebuggee(g); + +g.eval("" + function f() { + var x = 42; + function g() { } + g(); +}); + +dbg.onEnterFrame = function (f) { + if (f.callee && (f.callee.name === "g")) + assertEq(f.environment.parent.getVariable("x").optimizedOut, true); +} + +g.f(); |