tor-browser

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

iterator-thisv-error.js (483B)


      1 /* Any copyright is dedicated to the Public Domain.
      2 * http://creativecommons.org/licenses/publicdomain/ */
      3 
      4 function test(fn, thisv) {
      5  var message;
      6  try {
      7    fn.call(thisv);
      8  } catch (e) {
      9    message = e.message;
     10  }
     11 
     12  assertEq(/^values method called on incompatible.+/.test(message), true);
     13 }
     14 
     15 for (var thisv of [null, undefined, false, true, 0, ""]) {
     16  test(Set.prototype.values, thisv);
     17  test(Set.prototype.keys, thisv);
     18  test(Set.prototype[Symbol.iterator], thisv);
     19 }