summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Environment-getVariable-04.js
blob: 850446f577a8774b60231fcacf9f249e4b06eaf1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
// getVariable sees variables in function scopes added by non-strict direct eval.

var g = newGlobal({newCompartment: true});
var dbg = Debugger(g);
var v;
dbg.onDebuggerStatement = function (frame) {
    v = frame.environment.getVariable("x");
};

g.eval("function f(s) { eval(s); debugger; }");
g.f("var x = 'Q';");
assertEq(v, 'Q');