tor-browser

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

onExceptionUnwind-resumption-01.js (304B)


      1 // Check that an onExceptionUnwind hook can force a frame to return a value early.
      2 
      3 var g = newGlobal({newCompartment: true});
      4 var dbg = Debugger(g);
      5 dbg.onExceptionUnwind = function (frame, exc) {
      6    return { return:"sproon" };
      7 };
      8 g.eval("function f() { throw 'ksnife'; }");
      9 assertEq(g.f(), "sproon");