1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/jit-test/tests/debug/Frame-eval-21.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,33 @@ 1.4 +// Eval-in-frame with different type on baseline frame with let-scoping 1.5 + 1.6 +load(libdir + "jitopts.js"); 1.7 + 1.8 +if (!jitTogglesMatch(Opts_BaselineEager)) 1.9 + quit(0); 1.10 + 1.11 +withJitOptions(Opts_BaselineEager, function () { 1.12 + var g = newGlobal(); 1.13 + var dbg = new Debugger; 1.14 + 1.15 + g.h = function h(d) { 1.16 + if (d) { 1.17 + dbg.addDebuggee(g); 1.18 + var f = dbg.getNewestFrame().older; 1.19 + assertEq(f.implementation, "baseline"); 1.20 + assertEq(f.environment.getVariable("foo"), 42); 1.21 + f.eval("foo = 'string of 42'"); 1.22 + } 1.23 + } 1.24 + 1.25 + g.eval("" + function f(d) { 1.26 + if (d) { 1.27 + let foo = 42; 1.28 + g(d); 1.29 + return foo; 1.30 + } 1.31 + }); 1.32 + 1.33 + g.eval("" + function g(d) { h(d); }); 1.34 + 1.35 + g.eval("(" + function () { assertEq(f(true), "string of 42"); } + ")();"); 1.36 +});