Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Array/from/iter-cstm-ctor-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: >
7 Error creating object with custom constructor (traversed via iterator)
8 info: |
9 [...]
10 6. If usingIterator is not undefined, then
11 a. If IsConstructor(C) is true, then
12 i. Let A be Construct(C).
13 b. Else,
14 i. Let A be ArrayCreate(0).
15 c. ReturnIfAbrupt(A).
16 features: [Symbol.iterator]
17 ---*/
18
19 var C = function() {
20 throw new Test262Error();
21 };
22 var items = {};
23 items[Symbol.iterator] = function() {};
24
25 assert.throws(Test262Error, function() {
26 Array.from.call(C, items);
27 });