summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Environment-find-07.js
blob: 1737f29fdbe9a6bd57fcc684ae9c34040ceee4e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// We can find into and from optimized out 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")) {
    genv = f.environment.parent;
    assertEq(genv.optimizedOut, true);
    assertEq(genv.find("f").type, "object");
    assertEq(f.environment.find("x"), genv);
  }
}

g.f();