summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Environment-setVariable-01.js
blob: 610960241cc30f8b6c187952660968b28e0eebfe (plain)
1
2
3
4
5
6
7
8
9
// Environment.prototype.setVariable can set global variables.

var g = newGlobal();
var dbg = Debugger(g);
dbg.onDebuggerStatement = function (frame) {
    frame.environment.parent.setVariable("x", 2);
};
g.eval("var x = 1; debugger;");
assertEq(g.x, 2);