tor-browser

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

onExceptionUnwind-14.js (776B)


      1 var g = newGlobal({newCompartment: true});
      2 var dbg = new Debugger(g);
      3 
      4 g.eval("" + function f() {
      5  throw 42;
      6 });
      7 
      8 g.eval("" + function g() {
      9  throw new Error("42");
     10 });
     11 
     12 // Call the functions once. This will compile them in Ion under --ion-eager.
     13 g.eval("try { f(); } catch (e) { }");
     14 g.eval("try { g(); } catch (e) { }");
     15 
     16 // Now set an onExceptionUnwind hook so that the Ion-compiled functions will
     17 // try to bail out. The tail of the bytecode for f and g looks like 'throw;
     18 // retrval', with 'retrval' being unreachable. Since 'throw' is resumeAfter,
     19 // bailing out for debug mode will attempt to resume at 'retrval'. Test that
     20 // this case is handled.
     21 dbg.onExceptionUnwind = function f() { };
     22 g.eval("try { f(); } catch (e) { }");
     23 g.eval("try { g(); } catch (e) { }");