diff -r 000000000000 -r 6474c204b198 js/src/jit-test/tests/debug/Environment-find-01.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/js/src/jit-test/tests/debug/Environment-find-01.js Wed Dec 31 06:09:35 2014 +0100 @@ -0,0 +1,19 @@ +// find sees that vars are hoisted out of with statements. + +var g = newGlobal(); +var dbg = Debugger(g); +var hits = 0; +dbg.onDebuggerStatement = function (frame) { + assertEq(frame.environment.find("x").type, "with"); + hits++; +}; + +assertEq(g.eval("(function () {\n" + + " function g() { x = 1; }\n" + + " with ({x: 2}) {\n" + + " var x;\n" + + " debugger;\n" + + " return x;\n" + + " }\n" + + "})();"), 2); +assertEq(hits, 1);