update Iterator Sequencing tests to reflect May 2025 plenary updates

This commit is contained in:
Michael Ficarra 2025-06-20 11:33:18 +09:00
parent a073f479f8
commit bdb051fcdd
2 changed files with 30 additions and 1 deletions

View File

@ -46,4 +46,4 @@ let iterResult = iterator.next();
assert.sameValue(iterResult.done, false);
assert.sameValue(iterResult.value, 123);
assert.sameValue(iterResult, oldIterResult);
assert.notSameValue(iterResult, oldIterResult);

View File

@ -0,0 +1,29 @@
// Copyright (C) 2025 Michael Ficarra. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-iterator.concat
description: >
Iterator.concat does not access the value of a done IteratorResult, diverging from the behaviour of yield*
features: [iterator-sequencing]
---*/
let valueAccesses = 0;
let iter = {
[Symbol.iterator]() {
return {
next() {
return {
get value() {
++valueAccesses;
},
done: true,
};
},
};
}
};
Array.from(Iterator.concat(iter, iter, iter));
assert.sameValue(valueAccesses, 0, 'Iterator.concat does not access value getter after each iterator is done');