summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Environment-setVariable-02.js
blob: 7fb7f5e02e461920a66751923a1efe58004c3eb8 (plain)
1
2
3
4
5
6
7
8
9
10
// The argument to setVariable can be a Debugger.Object.

var g = newGlobal({newCompartment: true});
var dbg = new Debugger;
var gw = dbg.addDebuggee(g);
dbg.onDebuggerStatement = function (frame) {
    frame.environment.parent.setVariable("x", gw);
};
g.eval("var x = 1; debugger;");
assertEq(g.x, g);