mirror of
https://github.com/tc39/test262.git
synced 2025-07-25 23:14:47 +02:00
Fix issues in async generator case files
Incorrect $DONE handlers which led to calling $DONE twice - async-generators/yield-promise-reject-next-yield-star-async-iterator.case - dstr-assignment-for-await/array-elem-trlg-iter-rest-nrml-close-skip.case $DONE handler not called at all: - dstr-assignment-for-await/array-elem-put-const.case - dstr-assignment-for-await/array-elem-trlg-iter-elision-iter-nrml-close-null.case Incorrect assumed execution sequence in IteratorDestructuringAssignmentEvaluation: - dstr-assignment-for-await/array-elem-iter-rtrn-close-null.case
This commit is contained in:
parent
c23ea89fe2
commit
f810ad2550
@ -28,4 +28,4 @@ iter.next().then(() => {
|
|||||||
assert.sameValue(done, true, "The value of IteratorResult.done is `true`");
|
assert.sameValue(done, true, "The value of IteratorResult.done is `true`");
|
||||||
assert.sameValue(value, undefined, "The value of IteratorResult.value is `undefined`");
|
assert.sameValue(value, undefined, "The value of IteratorResult.value is `undefined`");
|
||||||
}).then($DONE, $DONE);
|
}).then($DONE, $DONE);
|
||||||
}).then($DONE, $DONE);
|
}, $DONE).catch($DONE);
|
||||||
|
@ -4,6 +4,12 @@
|
|||||||
desc: >
|
desc: >
|
||||||
IteratorClose throws a TypeError when `return` returns a non-Object value
|
IteratorClose throws a TypeError when `return` returns a non-Object value
|
||||||
info: |
|
info: |
|
||||||
|
AssignmentElement : DestructuringAssignmentTarget Initializer
|
||||||
|
1. If DestructuringAssignmentTarget is neither an ObjectLiteral nor an ArrayLiteral, then
|
||||||
|
a. Let lref be the result of evaluating DestructuringAssignmentTarget.
|
||||||
|
b. ReturnIfAbrupt(lref).
|
||||||
|
[...]
|
||||||
|
|
||||||
ArrayAssignmentPattern : [ AssignmentElementList ]
|
ArrayAssignmentPattern : [ AssignmentElementList ]
|
||||||
|
|
||||||
[...]
|
[...]
|
||||||
@ -43,7 +49,12 @@ iterable
|
|||||||
//- body
|
//- body
|
||||||
unreachable += 1;
|
unreachable += 1;
|
||||||
//- teardown
|
//- teardown
|
||||||
iter.next().then(() => $DONE('Promise incorrectly fulfilled.'), ({ constructor }) => {
|
iter.next().then(result => {
|
||||||
assert.sameValue(unreachable, 0);
|
assert.sameValue(result.value, undefined);
|
||||||
assert.sameValue(constructor, TypeError);
|
assert.sameValue(result.done, false);
|
||||||
}).then($DONE, $DONE);
|
|
||||||
|
iter.return().then(() => $DONE('Promise incorrectly fulfilled.'), ({ constructor }) => {
|
||||||
|
assert.sameValue(unreachable, 0);
|
||||||
|
assert.sameValue(constructor, TypeError);
|
||||||
|
}).then($DONE, $DONE);
|
||||||
|
}, $DONE).catch($DONE);
|
||||||
|
@ -15,3 +15,8 @@ const c = null;
|
|||||||
[ c ]
|
[ c ]
|
||||||
//- vals
|
//- vals
|
||||||
[1]
|
[1]
|
||||||
|
//- teardown
|
||||||
|
promise.then(() => $DONE('Promise incorrectly fulfilled.'), ({ constructor }) => {
|
||||||
|
assert.sameValue(iterCount, 0);
|
||||||
|
assert.sameValue(constructor, TypeError);
|
||||||
|
}).then($DONE, $DONE);
|
||||||
|
@ -57,3 +57,9 @@ TypeError
|
|||||||
[ x , , ]
|
[ x , , ]
|
||||||
//- vals
|
//- vals
|
||||||
iterable
|
iterable
|
||||||
|
//- teardown
|
||||||
|
promise.then(() => $DONE('Promise incorrectly fulfilled.'), ({ constructor }) => {
|
||||||
|
assert.sameValue(iterCount, 0);
|
||||||
|
assert.sameValue(nextCount, 2);
|
||||||
|
assert.sameValue(constructor, TypeError);
|
||||||
|
}).then($DONE, $DONE);
|
||||||
|
@ -52,4 +52,4 @@ iter.next().then(() => {
|
|||||||
assert.sameValue(x, 1, 'x');
|
assert.sameValue(x, 1, 'x');
|
||||||
assert.sameValue(y.length, 0, 'y.length');
|
assert.sameValue(y.length, 0, 'y.length');
|
||||||
}).then($DONE, $DONE);
|
}).then($DONE, $DONE);
|
||||||
}).then($DONE, $DONE);
|
}, $DONE).catch($DONE);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user