summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Environment-getVariable-11.js
blob: ac144407ebe884fe52614cd6e37a9ed3ee5f1850 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// The value returned by getVariable can be a Debugger.Object.

var g = newGlobal();
var dbg = new Debugger;
var gw = dbg.addDebuggee(g);
var hits = 0;
dbg.onDebuggerStatement = function (frame) {
    var a = frame.environment.parent.getVariable('Math');
    assertEq(a instanceof Debugger.Object, true);
    var b = gw.getOwnPropertyDescriptor('Math').value;
    assertEq(a, b);
    hits++;
};
g.eval("debugger;");
assertEq(hits, 1);