tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

uncaughtExceptionHook-03.js (871B)


      1 // |jit-test| error: ReferenceError
      2 // If uncaughtExceptionHook is absent, the debuggee is terminated.
      3 
      4 var g = newGlobal({newCompartment: true});
      5 g.debuggeeGlobal = this;
      6 g.eval("(" + function () {
      7        var dbg = Debugger(debuggeeGlobal);
      8        dbg.onDebuggerStatement = function (frame) {
      9            if (frame.callee === null) {
     10                debuggeeGlobal.log += '1';
     11                var cv = frame.eval("f();");
     12                debuggeeGlobal.log += '2';
     13                assertEq(cv, null);
     14            } else {
     15                assertEq(frame.callee.name, "f");
     16                debuggeeGlobal.log += '3';
     17                throw new ReferenceError("oops");
     18            }
     19        };
     20    } + ")();");
     21 
     22 function onerror(msg) {
     23 }
     24 
     25 var log = '';
     26 debugger;
     27 function f() {
     28    try {
     29        debugger;
     30    } finally {
     31        log += 'x';
     32    }
     33 }
     34 assertEq(log, '132');