summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Environment-setVariable-07.js
blob: 5e3cdd177875a6303c839ca47a2480af5ead353b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// setVariable works on let-bindings.

var g = newGlobal();
function test(code, val) {
    g.eval("function f() { " + code + " }");
    var dbg = new Debugger(g);
    dbg.onDebuggerStatement = function (frame) {
        frame.environment.setVariable("a", val);
    };
    assertEq(g.f(), val);
}

test("let a = 1; debugger; return a;", "xyzzy");
test("{ let a = 1; debugger; return a; }", "plugh");