js/src/jit-test/tests/debug/onEnterFrame-06.js

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)

     1 // The tracejit does not prevent onEnterFrame from being called after entering
     2 // a debuggee compartment from a non-debuggee compartment.
     4 var g1 = newGlobal();
     5 var g2 = newGlobal();
     6 var dbg = Debugger(g1, g2);
     7 dbg.removeDebuggee(g2); // turn off debug mode in g2
     9 g1.eval("function f() { return 1; }\n");
    10 var N = g1.N = 11;
    11 g1.eval("function h() {\n" +
    12        "    for (var i = 0; i < N; i += f()) {}\n" +
    13        "}");
    14 g1.h(); // record loop
    16 var log = '';
    17 dbg.onEnterFrame = function (frame) { log += frame.callee.name; };
    18 g1.h();
    19 assertEq(log, 'h' + Array(N + 1).join('f'));

mercurial