michael@0: // Eval-in-frame with different type on non-youngest Ion frame. michael@0: michael@0: load(libdir + "jitopts.js"); michael@0: michael@0: if (!jitTogglesMatch(Opts_Ion2NoParallelCompilation)) michael@0: quit(0); michael@0: michael@0: withJitOptions(Opts_Ion2NoParallelCompilation, function () { michael@0: function test(shadow) { michael@0: var g = newGlobal(); michael@0: var dbg = new Debugger; michael@0: michael@0: // Note that we depend on CCW scripted functions being opaque to Ion michael@0: // optimization for this test. michael@0: g.h = function h(d) { michael@0: if (d) { michael@0: dbg.addDebuggee(g); michael@0: var f = dbg.getNewestFrame().older; michael@0: assertEq(f.implementation, "ion"); michael@0: assertEq(f.environment.getVariable("foo"), 42); michael@0: michael@0: // EIF of a different type too. michael@0: f.eval((shadow ? "var " : "") + "foo = 'string of 42'"); michael@0: g.expected = shadow ? 42 : "string of 42"; michael@0: } michael@0: } michael@0: michael@0: g.eval("" + function f(d) { michael@0: var foo = 42; michael@0: g(d); michael@0: return foo; michael@0: }); michael@0: g.eval("" + function g(d) { michael@0: h(d); michael@0: }); michael@0: michael@0: g.eval("(" + function () { michael@0: for (i = 0; i < 5; i++) michael@0: f(false); michael@0: assertEq(f(true), "string of 42"); michael@0: } + ")();"); michael@0: } michael@0: michael@0: test(false); michael@0: test(true); michael@0: });