Skip to content

Commit bdb051f

Browse files
update Iterator Sequencing tests to reflect May 2025 plenary updates
1 parent a073f47 commit bdb051f

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

test/built-ins/Iterator/concat/fresh-iterator-result.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,4 @@ let iterResult = iterator.next();
4646
assert.sameValue(iterResult.done, false);
4747
assert.sameValue(iterResult.value, 123);
4848

49-
assert.sameValue(iterResult, oldIterResult);
49+
assert.notSameValue(iterResult, oldIterResult);
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Copyright (C) 2025 Michael Ficarra. All rights reserved.
2+
// This code is governed by the BSD license found in the LICENSE file.
3+
4+
/*---
5+
esid: sec-iterator.concat
6+
description: >
7+
Iterator.concat does not access the value of a done IteratorResult, diverging from the behaviour of yield*
8+
features: [iterator-sequencing]
9+
---*/
10+
11+
let valueAccesses = 0;
12+
let iter = {
13+
[Symbol.iterator]() {
14+
return {
15+
next() {
16+
return {
17+
get value() {
18+
++valueAccesses;
19+
},
20+
done: true,
21+
};
22+
},
23+
};
24+
}
25+
};
26+
27+
Array.from(Iterator.concat(iter, iter, iter));
28+
29+
assert.sameValue(valueAccesses, 0, 'Iterator.concat does not access value getter after each iterator is done');

0 commit comments

Comments
 (0)