summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Environment-getVariable-07.js
blob: 9f48d3208e8b983030c386e84e40d31f3bc4644a (plain)
1
2
3
4
5
6
7
8
9
10
// getVariable can get properties from with-block scopes.

var g = newGlobal({newCompartment: true});
var dbg = Debugger(g);
var v;
dbg.onDebuggerStatement = function (frame) {
    v = frame.environment.getVariable("x");
};
g.eval("var x = 1; { let x = 2; with ({x: 3}) { debugger; } }");
assertEq(v, 3);