js/src/jit-test/tests/debug/resumption-05.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 // null resumption value means terminate the debuggee
     4 var g = newGlobal();
     5 g.debuggeeGlobal = this;
     6 g.eval("(" + function () { 
     7         var dbg = new Debugger(debuggeeGlobal);
     8         dbg.onDebuggerStatement = function (frame) {
     9             if (frame.callee === null) {
    10                 // The first debugger statement below.
    11                 debuggeeGlobal.log += "1";
    12                 var cv = frame.eval("f();");
    13                 assertEq(cv, null);
    14                 debuggeeGlobal.log += "2";
    15             } else {
    16                 // The second debugger statement.
    17                 debuggeeGlobal.log += "3";
    18                 assertEq(frame.callee.name, "f");
    19                 return null;
    20             }
    21         };
    22     } + ")()");
    24 var log = "";
    25 debugger;
    27 function f() {
    28     log += "4";
    29     try {
    30         debugger;  // the debugger terminates us here
    31     } finally {
    32         log += "5";  // this should not execute
    33     }
    34 }
    36 assertEq(log, "1432");

mercurial