js/src/jit-test/tests/debug/Frame-eval-21.js

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:b0b5994cb67d
1 // Eval-in-frame with different type on baseline frame with let-scoping
2
3 load(libdir + "jitopts.js");
4
5 if (!jitTogglesMatch(Opts_BaselineEager))
6 quit(0);
7
8 withJitOptions(Opts_BaselineEager, function () {
9 var g = newGlobal();
10 var dbg = new Debugger;
11
12 g.h = function h(d) {
13 if (d) {
14 dbg.addDebuggee(g);
15 var f = dbg.getNewestFrame().older;
16 assertEq(f.implementation, "baseline");
17 assertEq(f.environment.getVariable("foo"), 42);
18 f.eval("foo = 'string of 42'");
19 }
20 }
21
22 g.eval("" + function f(d) {
23 if (d) {
24 let foo = 42;
25 g(d);
26 return foo;
27 }
28 });
29
30 g.eval("" + function g(d) { h(d); });
31
32 g.eval("(" + function () { assertEq(f(true), "string of 42"); } + ")();");
33 });

mercurial