1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/jit-test/tests/debug/Frame-evalWithBindings-07.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,16 @@ 1.4 +// var statements in strict evalWithBindings code behave like strict eval. 1.5 +var g = newGlobal(); 1.6 +var dbg = new Debugger(g); 1.7 +var hits = 0; 1.8 +dbg.onDebuggerStatement = function (frame) { 1.9 + assertEq(frame.evalWithBindings("var i = a*a + b*b; i === 25;", {a: 3, b: 4}).return, true); 1.10 + hits++; 1.11 +}; 1.12 +g.eval("'use strict'; debugger;"); 1.13 +assertEq(hits, 1); 1.14 +assertEq("i" in g, false); 1.15 + 1.16 +g.eval("function die() { throw fit; }"); 1.17 +g.eval("Object.defineProperty(this, 'i', {get: die, set: die});"); 1.18 +g.eval("'use strict'; debugger;"); 1.19 +assertEq(hits, 2);