tor-browser

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

is-constructor-on-wrapper.js (380B)


      1 var g = newGlobal();
      2 var w = g.eval("() => {}");
      3 var v = g.eval("Array");
      4 
      5 try {
      6    Reflect.construct(Array, [], w);
      7    assertEq(true, false, "Expected exception above");
      8 } catch (e) {
      9    assertEq(e.constructor, TypeError);
     10 }
     11 
     12 try {
     13    Reflect.construct(v, [], w);
     14    assertEq(true, false, "Expected exception above");
     15 } catch (e) {
     16    assertEq(e.constructor, TypeError);
     17 }