michael@0: // setVariable works on let-bindings. michael@0: michael@0: var g = newGlobal(); michael@0: function test(code, val) { michael@0: g.eval("function f() { " + code + " }"); michael@0: var dbg = new Debugger(g); michael@0: dbg.onDebuggerStatement = function (frame) { michael@0: frame.environment.setVariable("a", val); michael@0: }; michael@0: assertEq(g.f(), val); michael@0: } michael@0: michael@0: test("let a = 1; debugger; return a;", "xyzzy"); michael@0: test("{ let a = 1; debugger; return a; }", "plugh"); michael@0: test("let (a = 1) { debugger; return a; }", "wcgr");