michael@0: // Direct eval code under evalWithBindings sees both the bindings and the enclosing scope. michael@0: michael@0: var g = newGlobal(); michael@0: var dbg = new Debugger(g); michael@0: var hits = 0; michael@0: dbg.onDebuggerStatement = function (frame) { michael@0: var code = michael@0: "assertEq(a, 1234);\n" + michael@0: "assertEq(b, null);\n" + michael@0: "assertEq(c, 'ok');\n"; michael@0: assertEq(frame.evalWithBindings("eval(s)", {s: code, a: 1234}).return, undefined); michael@0: hits++; michael@0: }; michael@0: g.eval("function f(b) { var c = 'ok'; debugger; }"); michael@0: g.f(null); michael@0: assertEq(hits, 1);