summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Environment-getVariable-14.js
blob: 237ea6e1ab146aaa2f459c226144df5f50947301 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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();