michael@0: // find sees that vars are hoisted out of with statements. michael@0: michael@0: var g = newGlobal(); michael@0: var dbg = Debugger(g); michael@0: var hits = 0; michael@0: dbg.onDebuggerStatement = function (frame) { michael@0: assertEq(frame.environment.find("x").type, "with"); michael@0: hits++; michael@0: }; michael@0: michael@0: assertEq(g.eval("(function () {\n" + michael@0: " function g() { x = 1; }\n" + michael@0: " with ({x: 2}) {\n" + michael@0: " var x;\n" + michael@0: " debugger;\n" + michael@0: " return x;\n" + michael@0: " }\n" + michael@0: "})();"), 2); michael@0: assertEq(hits, 1);