blob: d3155e9571fae3a7dd6b976262e52418168b1330 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
// getVariable works on ancestors of frame.environment.
var g = newGlobal();
var dbg = Debugger(g);
var log = '';
dbg.onDebuggerStatement = function (frame) {
for (var env = frame.environment; env; env = env.parent) {
if (env.find("x") === env)
log += env.getVariable("x");
}
};
g.eval("var x = 1; { let x = 2; with (Object.create({x: 3})) { debugger; } }");
assertEq(log, "321");
|