tor-browser

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

get-iter-method-err.js (642B)


      1 // Copyright (C) 2015 the V8 project authors. All rights reserved.
      2 // This code is governed by the BSD license found in the LICENSE file.
      3 /*---
      4 esid: sec-array.from
      5 description: Error accessing items' `Symbol.iterator` attribute
      6 info: |
      7    [...]
      8    4. Let usingIterator be GetMethod(items, @@iterator).
      9    5. ReturnIfAbrupt(usingIterator).
     10 features: [Symbol.iterator]
     11 ---*/
     12 
     13 var items = {};
     14 Object.defineProperty(items, Symbol.iterator, {
     15  get: function() {
     16    throw new Test262Error();
     17  }
     18 });
     19 
     20 assert.throws(Test262Error, function() {
     21  Array.from(items);
     22 }, 'Array.from(items) throws a Test262Error exception');
     23 
     24 reportCompare(0, 0);