Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Array/from/get-iter-method-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 accessing items' `Symbol.iterator` attribute
7 info: |
8 [...]
9 4. Let usingIterator be GetMethod(items, @@iterator).
10 5. ReturnIfAbrupt(usingIterator).
11 features: [Symbol.iterator]
12 ---*/
13
14 var items = {};
15 Object.defineProperty(items, Symbol.iterator, {
16 get: function() {
17 throw new Test262Error();
18 }
19 });
20
21 assert.throws(Test262Error, function() {
22 Array.from(items);
23 });