tor-browser

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

onExceptionUnwind-resumption-03.js (347B)


      1 // Check that an onExceptionUnwind hook can force a frame to throw a different exception.
      2 
      3 load(libdir + "asserts.js");
      4 
      5 var g = newGlobal({newCompartment: true});
      6 var dbg = Debugger(g);
      7 dbg.onExceptionUnwind = function (frame, exc) {
      8    return { throw:"sproon" };
      9 };
     10 g.eval("function f() { throw 'ksnife'; }");
     11 assertThrowsValue(g.f, "sproon");