Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Array/from/iter-get-iter-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 creating iterator object
7 info: |
8 [...]
9 6. If usingIterator is not undefined, then
10 [...]
11 d. Let iterator be GetIterator(items, usingIterator).
12 e. ReturnIfAbrupt(iterator).
13 features: [Symbol.iterator]
14 ---*/
15
16 var items = {};
17 items[Symbol.iterator] = function() {
18 throw new Test262Error();
19 };
20
21 assert.throws(Test262Error, function() {
22 Array.from(items);
23 });