js/src/jit-test/tests/debug/onEnterFrame-02.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 // enterFrame test with recursive debuggee function.
     3 var g = newGlobal();
     4 var N = g.N = 9;
     5 g.eval("function f(i) { if (i < N) f(i + 1); }");
     7 var dbg = Debugger(g);
     8 var arr = [];
     9 dbg.onEnterFrame = function (frame) {
    10     var i;
    11     for (i = 0; i < arr.length; i++)
    12         assertEq(frame !== arr[i], true);
    13     arr[i] = frame;
    15     // Check that the whole stack is as expected.
    16     var j = i;
    17     for (; frame; frame = frame.older)
    18         assertEq(arr[j--], frame);
    19 };
    21 g.f(0);
    22 assertEq(arr.length, N + 1);

mercurial