blob: 9b3bbd9e1c423d5bef64174eeaf8d0bdbc6b3fae (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
// Environment.prototype.getVariable does not see variables bound in enclosing scopes.
var g = newGlobal({newCompartment: true});
var dbg = Debugger(g);
var hits = 0;
dbg.onDebuggerStatement = function (frame) {
assertEq(frame.environment.getVariable("x"), 13);
assertEq(frame.environment.getVariable("k"), undefined);
assertEq(frame.environment.find("k").getVariable("k"), 3);
hits++;
};
g.eval("var k = 3; function f(x) { debugger; }");
g.f(13);
assertEq(hits, 1);
|