Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Array/from/iter-adv-err.js

raw
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 es6id: 22.1.2.1
6 description: Error advancing iterator
7 info: |
8 [...]
9 6. If usingIterator is not undefined, then
10 [...]
11 g. Repeat
12 i. Let Pk be ToString(k).
13 ii. Let next be IteratorStep(iterator).
14 iii. ReturnIfAbrupt(next).
15 features: [Symbol.iterator]
16 ---*/
17
18 var items = {};
19 items[Symbol.iterator] = function() {
20 return {
21 next: function() {
22 throw new Test262Error();
23 }
24 };
25 };
26
27 assert.throws(Test262Error, function() {
28 Array.from(items);
29 });