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

var g = newGlobal();
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);