summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Environment-setVariable-04.js
blob: d4b2347c79fad10424d6f93ede4daf4df549db37 (plain)
1
2
3
4
5
6
7
8
9
10
// setVariable can set variables and arguments in functions.

var g = newGlobal({newCompartment: true});
var dbg = new Debugger(g);
dbg.onDebuggerStatement = function (frame) {
    frame.environment.setVariable("a", 100);
    frame.environment.setVariable("b", 200);
};
g.eval("function f(a) { var b = a + 1; debugger; return a + b; }");
assertEq(g.f(1), 300);