zero-arguments.js (1012B)
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. 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 Iterator.concat when called with zero arguments. 9 info: | 10 Iterator.concat ( ...items ) 11 12 1. Let iterables be a new empty List. 13 2. For each element item of items, do 14 ... 15 3. Let closure be a new Abstract Closure with no parameters that captures iterables and performs the following steps when called: 16 a. For each Record iterable of iterables, do 17 ... 18 b. Return ReturnCompletion(undefined). 19 ... 20 6. Return gen. 21 features: [iterator-sequencing] 22 ---*/ 23 24 let iterator = Iterator.concat(); 25 26 let iterResult = iterator.next(); 27 28 assert.sameValue(iterResult.done, true); 29 assert.sameValue(iterResult.value, undefined); 30 31 reportCompare(0, 0);