tor-browser

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

get-next-method-throws.js (557B)


      1 // Copyright (C) 2023 Michael Ficarra. All rights reserved.
      2 // This code is governed by the BSD license found in the LICENSE file.
      3 /*---
      4 esid: sec-iterator.from
      5 description: >
      6  Underlying iterator has throwing next getter
      7 info: |
      8  Iterator.from ( O )
      9 
     10  4. Let iterated be ? GetIteratorDirect(O).
     11 
     12 features: [iterator-helpers]
     13 flags: []
     14 ---*/
     15 class ThrowingIterator {
     16  get next() {
     17    throw new Test262Error();
     18  }
     19 }
     20 
     21 let iterator = new ThrowingIterator();
     22 
     23 assert.throws(Test262Error, function () {
     24  Iterator.from(iterator);
     25 });
     26 
     27 reportCompare(0, 0);