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

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 // Eval-in-frame with different type on baseline frame with let-scoping
     3 load(libdir + "jitopts.js");
     5 if (!jitTogglesMatch(Opts_BaselineEager))
     6   quit(0);
     8 withJitOptions(Opts_BaselineEager, function () {
     9   var g = newGlobal();
    10   var dbg = new Debugger;
    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   }
    22   g.eval("" + function f(d) {
    23     if (d) {
    24       let foo = 42;
    25       g(d);
    26       return foo;
    27     }
    28   });
    30   g.eval("" + function g(d) { h(d); });
    32   g.eval("(" + function () { assertEq(f(true), "string of 42"); } + ")();");
    33 });

mercurial