mirror of
https://github.com/tc39/test262.git
synced 2025-07-25 06:55:06 +02:00
update Iterator Sequencing tests to reflect May 2025 plenary updates
This commit is contained in:
parent
a073f479f8
commit
bdb051fcdd
@ -46,4 +46,4 @@ let iterResult = iterator.next();
|
|||||||
assert.sameValue(iterResult.done, false);
|
assert.sameValue(iterResult.done, false);
|
||||||
assert.sameValue(iterResult.value, 123);
|
assert.sameValue(iterResult.value, 123);
|
||||||
|
|
||||||
assert.sameValue(iterResult, oldIterResult);
|
assert.notSameValue(iterResult, oldIterResult);
|
||||||
|
29
test/built-ins/Iterator/concat/get-value-after-done.js
Normal file
29
test/built-ins/Iterator/concat/get-value-after-done.js
Normal 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');
|
Loading…
x
Reference in New Issue
Block a user