js/src/jit-test/tests/debug/Frame-live-02.js

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 // |jit-test| debug
     2 // Debugger.Frame.prototype.live is false for frames that have thrown or been thrown through
     4 load(libdir + "asserts.js");
     6 var g = newGlobal();
     7 g.debuggeeGlobal = this;
     8 g.eval("var finalCheck;");
     9 g.eval("(" + function () {
    10         var a = [];
    11         var dbg = Debugger(debuggeeGlobal);
    12         dbg.onDebuggerStatement = function (frame) {
    13             a.push(frame);
    14             for (var i = 0; i < a.length; i++)
    15                 assertEq(a[i].live, true);
    16         };
    17         finalCheck = function (n) {
    18             assertEq(a.length, n);
    19             for (var i = 0; i < n; i++)
    20                 assertEq(a[i].live, false);
    21         };
    22     } + ")()");
    24 function f(n) {
    25     debugger;
    26     if (--n > 0)
    27         f(n);
    28     else
    29         throw "fit";
    30 }
    32 assertThrowsValue(function () { f(10); }, "fit");
    33 g.finalCheck(10);

mercurial