tor-browser

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

WeakMap-constructor-non-iterable.js (395B)


      1 // WeakMap should throw if argument is not iterable object.
      2 
      3 load(libdir + "asserts.js");
      4 load(libdir + "iteration.js");
      5 
      6 var non_iterable1 = {};
      7 non_iterable1[Symbol.iterator] = {};
      8 assertThrowsInstanceOf(() => new WeakMap(non_iterable1), TypeError);
      9 
     10 var non_iterable2 = {};
     11 non_iterable2[Symbol.iterator] = function() {
     12 };
     13 assertThrowsInstanceOf(() => new WeakMap(non_iterable2), TypeError);