Debian Codegraph @

js/src/tests/test262/built-ins/Iterator/concat/result-is-iterator.js

raw
1 // |reftest| shell-option(--enable-iterator-sequencing) skip-if(!Iterator.concat||!xulRuntime.shell) -- iterator-sequencing is not enabled unconditionally, requires shell-options
2 // Copyright (C) 2024 André Bargull and Michael Ficarra. All rights reserved.
3 // This code is governed by the BSD license found in the LICENSE file.
4
5 /*---
6 esid: sec-iterator.concat
7 description: >
8 The value of the [[Prototype]] internal slot of the return value of Iterator.concat
9 is the intrinsic object %IteratorHelperPrototype%.
10 features: [iterator-sequencing]
11 ---*/
12
13 var iter = Iterator.concat();
14 assert(iter instanceof Iterator, "Iterator.concat() must return an Iterator");
15
16 var customIter = { next() { return { done: true, value: undefined }; } };
17 iter = Iterator.concat({ [Symbol.iterator]() { return customIter; } });
18 assert(iter instanceof Iterator, "Iterator.concat(...) must return an Iterator");
19
20 reportCompare(0, 0);