tor-browser

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

newpromisecapability-error-message.js (642B)


      1 // |jit-test| skip-if: getBuildConfiguration('pbl')
      2 // (justification: PBL does not invoke the decompiler in the same way and so
      3 // will not have an error message referring to the specific value name)
      4 load(libdir + "asserts.js");
      5 
      6 let foo = {};
      7 for (let method of ["resolve", "reject", "race"]) {
      8  assertErrorMessage(
      9    () => Promise[method].call(foo),
     10    TypeError,
     11    "foo is not a constructor"
     12  );
     13  assertErrorMessage(
     14    () => Promise[method].call(foo, []),
     15    TypeError,
     16    "foo is not a constructor"
     17  );
     18  assertErrorMessage(
     19    () => Promise[method].call({}, [], foo),
     20    TypeError,
     21    "({}) is not a constructor"
     22  );
     23 }