Debian Codegraph @

js/src/tests/test262/built-ins/Iterator/from/supports-iterable.js

raw
1 // |reftest| shell-option(--enable-iterator-helpers) skip-if(!this.hasOwnProperty('Iterator')||!xulRuntime.shell) -- iterator-helpers is not enabled unconditionally, requires shell-options
2 // Copyright (C) 2023 Michael Ficarra. All rights reserved.
3 // This code is governed by the BSD license found in the LICENSE file.
4 /*---
5 esid: sec-iterator.from
6 description: >
7 Iterator.from supports iterables
8 info: |
9 Iterator.from ( O )
10
11 includes: [compareArray.js]
12 features: [iterator-helpers]
13 flags: []
14 ---*/
15 assert.compareArray(Array.from(Iterator.from([0, 1, 2, 3])), [0, 1, 2, 3]);
16 assert.compareArray(Array.from(Iterator.from(new String('str'))), ['s', 't', 'r']);
17
18 reportCompare(0, 0);