Bug 1364608 - Stash rval in AsyncIteratorClose. (r=arai)

This commit is contained in:
Shu-yu Guo 2017-05-19 15:48:19 -07:00
Родитель 8b07ba2a07
Коммит f9087690d7
2 изменённых файлов: 16 добавлений и 8 удалений

Просмотреть файл

@ -5422,7 +5422,14 @@ BytecodeEmitter::emitIteratorClose(IteratorKind iterKind /* = IteratorKind::Sync
checkTypeSet(JSOP_CALL);
if (iterKind == IteratorKind::Async) {
if (!emitAwait()) // ... ... RESULT
if (completionKind != CompletionKind::Throw) {
// Await clobbers rval, so save the current rval.
if (!emit1(JSOP_GETRVAL)) // ... ... RESULT RVAL
return false;
if (!emit1(JSOP_SWAP)) // ... ... RVAL RESULT
return false;
}
if (!emitAwait()) // ... ... RVAL? RESULT
return false;
}
@ -5450,8 +5457,15 @@ BytecodeEmitter::emitIteratorClose(IteratorKind iterKind /* = IteratorKind::Sync
if (!emitPopN(2)) // ... RESULT
return false;
} else {
if (!emitCheckIsObj(CheckIsObjectKind::IteratorReturn)) // ... RESULT
if (!emitCheckIsObj(CheckIsObjectKind::IteratorReturn)) // ... RVAL? RESULT
return false;
if (iterKind == IteratorKind::Async) {
if (!emit1(JSOP_SWAP)) // ... RESULT RVAL
return false;
if (!emit1(JSOP_SETRVAL)) // ... RESULT
return false;
}
}
if (!ifReturnMethodIsDefined.emitElse())

Просмотреть файл

@ -507,17 +507,11 @@ skip script test262/language/statements/for-await-of/async-func-dstr-let-ary-ptr
skip script test262/language/statements/for-await-of/async-func-dstr-let-ary-ptrn-rest-id-iter-step-err.js
skip script test262/language/statements/for-await-of/async-func-dstr-var-ary-ptrn-elision-step-err.js
skip script test262/language/statements/for-await-of/async-func-dstr-var-ary-ptrn-rest-id-iter-step-err.js
skip script test262/language/statements/for-await-of/async-gen-dstr-const-ary-ptrn-elision-iter-close.js
skip script test262/language/statements/for-await-of/async-gen-dstr-const-ary-ptrn-elision-step-err.js
skip script test262/language/statements/for-await-of/async-gen-dstr-const-ary-ptrn-rest-id-iter-close.js
skip script test262/language/statements/for-await-of/async-gen-dstr-const-ary-ptrn-rest-id-iter-step-err.js
skip script test262/language/statements/for-await-of/async-gen-dstr-let-ary-ptrn-elision-iter-close.js
skip script test262/language/statements/for-await-of/async-gen-dstr-let-ary-ptrn-elision-step-err.js
skip script test262/language/statements/for-await-of/async-gen-dstr-let-ary-ptrn-rest-id-iter-step-err.js
skip script test262/language/statements/for-await-of/async-gen-dstr-let-ary-ptrn-rest-id-iter-close.js
skip script test262/language/statements/for-await-of/async-gen-dstr-var-ary-ptrn-elision-iter-close.js
skip script test262/language/statements/for-await-of/async-gen-dstr-var-ary-ptrn-elision-step-err.js
skip script test262/language/statements/for-await-of/async-gen-dstr-var-ary-ptrn-rest-id-iter-close.js
skip script test262/language/statements/for-await-of/async-gen-dstr-var-ary-ptrn-rest-id-iter-step-err.js
# Missing expression statement restriction for "async function"