1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/jit-test/tests/debug/Frame-evalWithBindings-10.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,16 @@ 1.4 +// Direct eval code under evalWithBindings sees both the bindings and the enclosing scope. 1.5 + 1.6 +var g = newGlobal(); 1.7 +var dbg = new Debugger(g); 1.8 +var hits = 0; 1.9 +dbg.onDebuggerStatement = function (frame) { 1.10 + var code = 1.11 + "assertEq(a, 1234);\n" + 1.12 + "assertEq(b, null);\n" + 1.13 + "assertEq(c, 'ok');\n"; 1.14 + assertEq(frame.evalWithBindings("eval(s)", {s: code, a: 1234}).return, undefined); 1.15 + hits++; 1.16 +}; 1.17 +g.eval("function f(b) { var c = 'ok'; debugger; }"); 1.18 +g.f(null); 1.19 +assertEq(hits, 1);