mirror of https://github.com/tc39/test262.git
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(value, undefined, "The value of IteratorResult.value is `undefined`");
|
||||
}).then($DONE, $DONE);
|
||||
}).then($DONE, $DONE);
|
||||
}, $DONE).catch($DONE);
|
||||
|
|
|
@ -4,6 +4,12 @@
|
|||
desc: >
|
||||
IteratorClose throws a TypeError when `return` returns a non-Object value
|
||||
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 ]
|
||||
|
||||
[...]
|
||||
|
@ -43,7 +49,12 @@ iterable
|
|||
//- body
|
||||
unreachable += 1;
|
||||
//- teardown
|
||||
iter.next().then(() => $DONE('Promise incorrectly fulfilled.'), ({ constructor }) => {
|
||||
assert.sameValue(unreachable, 0);
|
||||
assert.sameValue(constructor, TypeError);
|
||||
}).then($DONE, $DONE);
|
||||
iter.next().then(result => {
|
||||
assert.sameValue(result.value, undefined);
|
||||
assert.sameValue(result.done, false);
|
||||
|
||||
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 ]
|
||||
//- vals
|
||||
[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 , , ]
|
||||
//- vals
|
||||
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(y.length, 0, 'y.length');
|
||||
}).then($DONE, $DONE);
|
||||
}).then($DONE, $DONE);
|
||||
}, $DONE).catch($DONE);
|
||||
|
|
Loading…
Reference in New Issue