summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Environment-getVariable-06.js
blob: 096f77d8e3cd2077554060e18fbb46a2dbf531f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
// getVariable sees properties inherited from the global object's prototype chain.

var g = newGlobal();
var dbg = Debugger(g);
var log = '';
dbg.onDebuggerStatement = function (frame) {
    log += frame.environment.parent.getVariable("x") + frame.environment.parent.getVariable("y");
};
g.eval("Object.getPrototypeOf(this).x = 'a';\n" +
       "Object.prototype.y = 'b';\n" +
       "debugger;\n");
assertEq(log, 'ab');