js/src/jit-test/tests/debug/Frame-onPop-error-throw.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 // |jit-test| error: TestComplete
     2 // onPop can change a termination into a throw.
     4 load(libdir + "asserts.js");
     5 var g = newGlobal();
     6 var dbg = new Debugger(g);
     8 function test(type, provocation) {
     9     var log;
    11     // Help people figure out which 'test' call failed.
    12     print("type:        " + uneval(type));
    13     print("provocation: " + uneval(provocation));
    15     dbg.onDebuggerStatement = function handleDebuggerStatement(f) {
    16         log += 'd';
    17         return null;
    18     };
    20     dbg.onEnterFrame = function handleEnterFrame(f) {
    21         log += '(';
    22         assertEq(f.type, type);
    23         f.onPop = function handlePop(c) {
    24             log += ')';
    25             assertEq(c, null);
    26             return { throw: 'snow' };
    27         };
    28     };
    30     log = '';
    31     assertThrowsValue(provocation, 'snow');
    32     assertEq(log, "(d)");
    34     print();
    35 }
    37 g.eval("function f() { debugger; return 'termination fail'; }");
    38 test("call", g.f);
    39 test("call", function () { return new g.f; });
    40 test("eval", function () { return g.eval("debugger; \'termination fail\';"); });
    41 test("global", function () { return g.evaluate("debugger; \'termination fail\';"); });
    42 throw 'TestComplete';

mercurial