fix(es/compat): Fix break in for await loop (#4705)

This commit is contained in:
magic-akari 2022-05-19 06:06:48 +08:00 committed by GitHub
parent 5b96e9f6f3
commit 100c0b58c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 69 additions and 69 deletions

View File

@ -66,7 +66,7 @@ function _main() {
break;
}
_ctx.next = 21;
return _iteratorError.return();
return _iterator.return();
case 21:
_ctx.prev = 21;
if (!_didIteratorError) {

View File

@ -29,7 +29,7 @@ swcHelpers.asyncToGenerator(function*() {
} finally{
try {
if (_iteratorAbruptCompletion && _iterator.return != null) {
yield _iteratorError.return();
yield _iterator.return();
}
} finally{
if (_didIteratorError) {

View File

@ -60,7 +60,7 @@ swcHelpers.asyncToGenerator(_regeneratorRuntime.default.mark(function _callee1()
break;
}
_ctx.next = 21;
return _iteratorError.return();
return _iterator.return();
case 21:
_ctx.prev = 21;
if (!_didIteratorError) {

View File

@ -21,7 +21,7 @@ function _f1() {
} finally{
try {
if (_iteratorAbruptCompletion && _iterator.return != null) {
yield _iteratorError.return();
yield _iterator.return();
}
} finally{
if (_didIteratorError) {
@ -53,7 +53,7 @@ function _f2() {
} finally{
try {
if (_iteratorAbruptCompletion && _iterator.return != null) {
yield _iteratorError.return();
yield _iterator.return();
}
} finally{
if (_didIteratorError) {
@ -85,7 +85,7 @@ function _f3() {
} finally{
try {
if (_iteratorAbruptCompletion && _iterator.return != null) {
yield _iteratorError.return();
yield _iterator.return();
}
} finally{
if (_didIteratorError) {
@ -117,7 +117,7 @@ function _f4() {
} finally{
try {
if (_iteratorAbruptCompletion && _iterator.return != null) {
yield _iteratorError.return();
yield _iterator.return();
}
} finally{
if (_didIteratorError) {
@ -151,7 +151,7 @@ function _f5() {
} finally{
try {
if (_iteratorAbruptCompletion && _iterator.return != null) {
yield _iteratorError.return();
yield _iterator.return();
}
} finally{
if (_didIteratorError) {
@ -185,7 +185,7 @@ function _f6() {
} finally{
try {
if (_iteratorAbruptCompletion && _iterator.return != null) {
yield _iteratorError.return();
yield _iterator.return();
}
} finally{
if (_didIteratorError) {
@ -219,7 +219,7 @@ function _f7() {
} finally{
try {
if (_iteratorAbruptCompletion && _iterator.return != null) {
yield _iteratorError.return();
yield _iterator.return();
}
} finally{
if (_didIteratorError) {

View File

@ -48,7 +48,7 @@ function _f1() {
break;
}
_ctx.next = 22;
return _iteratorError.return();
return _iterator.return();
case 22:
_ctx.prev = 22;
if (!_didIteratorError) {
@ -127,7 +127,7 @@ function _f2() {
break;
}
_ctx.next = 22;
return _iteratorError.return();
return _iterator.return();
case 22:
_ctx.prev = 22;
if (!_didIteratorError) {
@ -206,7 +206,7 @@ function _f3() {
break;
}
_ctx.next = 22;
return _iteratorError.return();
return _iterator.return();
case 22:
_ctx.prev = 22;
if (!_didIteratorError) {
@ -285,7 +285,7 @@ function _f4() {
break;
}
_ctx.next = 22;
return _iteratorError.return();
return _iterator.return();
case 22:
_ctx.prev = 22;
if (!_didIteratorError) {
@ -364,7 +364,7 @@ function _f5() {
break;
}
_ctx.next = 24;
return _iteratorError.return();
return _iterator.return();
case 24:
_ctx.prev = 24;
if (!_didIteratorError) {
@ -443,7 +443,7 @@ function _f6() {
break;
}
_ctx.next = 24;
return _iteratorError.return();
return _iterator.return();
case 24:
_ctx.prev = 24;
if (!_didIteratorError) {
@ -524,7 +524,7 @@ function _f7() {
break;
}
_ctx.next = 22;
return _iteratorError.return();
return _iterator.return();
case 22:
_ctx.prev = 22;
if (!_didIteratorError) {

View File

@ -41,7 +41,7 @@ function _asyncfn() {
} finally{
try {
if (_iteratorAbruptCompletion && _iterator.return != null) {
yield _iteratorError.return();
yield _iterator.return();
}
} finally{
if (_didIteratorError) {
@ -64,7 +64,7 @@ function _asyncfn() {
} finally{
try {
if (_iteratorAbruptCompletion1 && _iterator1.return != null) {
yield _iteratorError1.return();
yield _iterator1.return();
}
} finally{
if (_didIteratorError1) {
@ -88,7 +88,7 @@ function _asyncfn() {
} finally{
try {
if (_iteratorAbruptCompletion2 && _iterator2.return != null) {
yield _iteratorError2.return();
yield _iterator2.return();
}
} finally{
if (_didIteratorError2) {
@ -111,7 +111,7 @@ function _asyncfn() {
} finally{
try {
if (_iteratorAbruptCompletion3 && _iterator3.return != null) {
yield _iteratorError3.return();
yield _iterator3.return();
}
} finally{
if (_didIteratorError3) {
@ -167,7 +167,7 @@ function _f3() {
} finally{
try {
if (_iteratorAbruptCompletion && _iterator.return != null) {
yield _iteratorError.return();
yield _iterator.return();
}
} finally{
if (_didIteratorError) {

View File

@ -106,7 +106,7 @@ function _asyncfn() {
break;
}
_ctx.next = 21;
return _iteratorError5.return();
return _iterator.return();
case 21:
_ctx.prev = 21;
if (!_didIteratorError5) {
@ -155,7 +155,7 @@ function _asyncfn() {
break;
}
_ctx.next = 47;
return _iteratorError2.return();
return _iterator2.return();
case 47:
_ctx.prev = 47;
if (!_didIteratorError2) {
@ -204,7 +204,7 @@ function _asyncfn() {
break;
}
_ctx.next = 73;
return _iteratorError3.return();
return _iterator3.return();
case 73:
_ctx.prev = 73;
if (!_didIteratorError3) {
@ -253,7 +253,7 @@ function _asyncfn() {
break;
}
_ctx.next = 99;
return _iteratorError4.return();
return _iterator4.return();
case 99:
_ctx.prev = 99;
if (!_didIteratorError4) {
@ -421,7 +421,7 @@ function _f3() {
break;
}
_ctx1.next = 23;
return _iteratorError6.return();
return _iterator.return();
case 23:
_ctx1.prev = 23;
if (!_didIteratorError6) {

View File

@ -18,7 +18,7 @@ function _f1() {
} finally{
try {
if (_iteratorAbruptCompletion && _iterator.return != null) {
yield _iteratorError.return();
yield _iterator.return();
}
} finally{
if (_didIteratorError) {
@ -40,7 +40,7 @@ function _f1() {
} finally{
try {
if (_iteratorAbruptCompletion1 && _iterator1.return != null) {
yield _iteratorError1.return();
yield _iterator1.return();
}
} finally{
if (_didIteratorError1) {
@ -62,7 +62,7 @@ function _f1() {
} finally{
try {
if (_iteratorAbruptCompletion2 && _iterator2.return != null) {
yield _iteratorError2.return();
yield _iterator2.return();
}
} finally{
if (_didIteratorError2) {
@ -84,7 +84,7 @@ function _f1() {
} finally{
try {
if (_iteratorAbruptCompletion3 && _iterator3.return != null) {
yield _iteratorError3.return();
yield _iterator3.return();
}
} finally{
if (_didIteratorError3) {
@ -106,7 +106,7 @@ function _f1() {
} finally{
try {
if (_iteratorAbruptCompletion4 && _iterator4.return != null) {
yield _iteratorError4.return();
yield _iterator4.return();
}
} finally{
if (_didIteratorError4) {
@ -128,7 +128,7 @@ function _f1() {
} finally{
try {
if (_iteratorAbruptCompletion5 && _iterator5.return != null) {
yield _iteratorError5.return();
yield _iterator5.return();
}
} finally{
if (_didIteratorError5) {
@ -159,7 +159,7 @@ function _f2() {
} finally{
try {
if (_iteratorAbruptCompletion && _iterator.return != null) {
yield _iteratorError.return();
yield _iterator.return();
}
} finally{
if (_didIteratorError) {
@ -181,7 +181,7 @@ function _f2() {
} finally{
try {
if (_iteratorAbruptCompletion6 && _iterator6.return != null) {
yield _iteratorError6.return();
yield _iterator6.return();
}
} finally{
if (_didIteratorError6) {
@ -203,7 +203,7 @@ function _f2() {
} finally{
try {
if (_iteratorAbruptCompletion7 && _iterator7.return != null) {
yield _iteratorError7.return();
yield _iterator7.return();
}
} finally{
if (_didIteratorError7) {
@ -225,7 +225,7 @@ function _f2() {
} finally{
try {
if (_iteratorAbruptCompletion8 && _iterator8.return != null) {
yield _iteratorError8.return();
yield _iterator8.return();
}
} finally{
if (_didIteratorError8) {
@ -247,7 +247,7 @@ function _f2() {
} finally{
try {
if (_iteratorAbruptCompletion9 && _iterator9.return != null) {
yield _iteratorError9.return();
yield _iterator9.return();
}
} finally{
if (_didIteratorError9) {
@ -269,7 +269,7 @@ function _f2() {
} finally{
try {
if (_iteratorAbruptCompletion10 && _iterator10.return != null) {
yield _iteratorError10.return();
yield _iterator10.return();
}
} finally{
if (_didIteratorError10) {

View File

@ -45,7 +45,7 @@ function _f1() {
break;
}
_ctx.next = 22;
return _iteratorError.return();
return _iterator.return();
case 22:
_ctx.prev = 22;
if (!_didIteratorError) {
@ -93,7 +93,7 @@ function _f1() {
break;
}
_ctx.next = 48;
return _iteratorError1.return();
return _iterator1.return();
case 48:
_ctx.prev = 48;
if (!_didIteratorError1) {
@ -141,7 +141,7 @@ function _f1() {
break;
}
_ctx.next = 74;
return _iteratorError2.return();
return _iterator2.return();
case 74:
_ctx.prev = 74;
if (!_didIteratorError2) {
@ -189,7 +189,7 @@ function _f1() {
break;
}
_ctx.next = 100;
return _iteratorError3.return();
return _iterator3.return();
case 100:
_ctx.prev = 100;
if (!_didIteratorError3) {
@ -237,7 +237,7 @@ function _f1() {
break;
}
_ctx.next = 126;
return _iteratorError4.return();
return _iterator4.return();
case 126:
_ctx.prev = 126;
if (!_didIteratorError4) {
@ -285,7 +285,7 @@ function _f1() {
break;
}
_ctx.next = 152;
return _iteratorError5.return();
return _iterator5.return();
case 152:
_ctx.prev = 152;
if (!_didIteratorError5) {
@ -423,7 +423,7 @@ function _f2() {
break;
}
_ctx.next = 22;
return _iteratorError.return();
return _iterator.return();
case 22:
_ctx.prev = 22;
if (!_didIteratorError) {
@ -471,7 +471,7 @@ function _f2() {
break;
}
_ctx.next = 48;
return _iteratorError6.return();
return _iterator6.return();
case 48:
_ctx.prev = 48;
if (!_didIteratorError6) {
@ -519,7 +519,7 @@ function _f2() {
break;
}
_ctx.next = 74;
return _iteratorError7.return();
return _iterator7.return();
case 74:
_ctx.prev = 74;
if (!_didIteratorError7) {
@ -567,7 +567,7 @@ function _f2() {
break;
}
_ctx.next = 100;
return _iteratorError8.return();
return _iterator8.return();
case 100:
_ctx.prev = 100;
if (!_didIteratorError8) {
@ -615,7 +615,7 @@ function _f2() {
break;
}
_ctx.next = 126;
return _iteratorError9.return();
return _iterator9.return();
case 126:
_ctx.prev = 126;
if (!_didIteratorError9) {
@ -663,7 +663,7 @@ function _f2() {
break;
}
_ctx.next = 152;
return _iteratorError10.return();
return _iterator10.return();
case 152:
_ctx.prev = 152;
if (!_didIteratorError10) {

View File

@ -19,7 +19,7 @@ function _f() {
} finally{
try {
if (_iteratorAbruptCompletion && _iterator.return != null) {
yield _iteratorError.return();
yield _iterator.return();
}
} finally{
if (_didIteratorError) {
@ -41,7 +41,7 @@ function _f() {
} finally{
try {
if (_iteratorAbruptCompletion1 && _iterator1.return != null) {
yield _iteratorError1.return();
yield _iterator1.return();
}
} finally{
if (_didIteratorError1) {
@ -63,7 +63,7 @@ function _f() {
} finally{
try {
if (_iteratorAbruptCompletion2 && _iterator2.return != null) {
yield _iteratorError2.return();
yield _iterator2.return();
}
} finally{
if (_didIteratorError2) {
@ -85,7 +85,7 @@ function _f() {
} finally{
try {
if (_iteratorAbruptCompletion3 && _iterator3.return != null) {
yield _iteratorError3.return();
yield _iterator3.return();
}
} finally{
if (_didIteratorError3) {

View File

@ -46,7 +46,7 @@ function _f() {
break;
}
_ctx.next = 23;
return _iteratorError.return();
return _iterator.return();
case 23:
_ctx.prev = 23;
if (!_didIteratorError) {
@ -94,7 +94,7 @@ function _f() {
break;
}
_ctx.next = 49;
return _iteratorError1.return();
return _iterator1.return();
case 49:
_ctx.prev = 49;
if (!_didIteratorError1) {
@ -142,7 +142,7 @@ function _f() {
break;
}
_ctx.next = 75;
return _iteratorError2.return();
return _iterator2.return();
case 75:
_ctx.prev = 75;
if (!_didIteratorError2) {
@ -190,7 +190,7 @@ function _f() {
break;
}
_ctx.next = 101;
return _iteratorError3.return();
return _iterator3.return();
case 101:
_ctx.prev = 101;
if (!_didIteratorError3) {

View File

@ -21,7 +21,7 @@ function _f1() {
} finally{
try {
if (_iteratorAbruptCompletion && _iterator.return != null) {
yield _iteratorError.return();
yield _iterator.return();
}
} finally{
if (_didIteratorError) {
@ -43,7 +43,7 @@ function _f1() {
} finally{
try {
if (_iteratorAbruptCompletion1 && _iterator1.return != null) {
yield _iteratorError1.return();
yield _iterator1.return();
}
} finally{
if (_didIteratorError1) {
@ -74,7 +74,7 @@ function _f2() {
} finally{
try {
if (_iteratorAbruptCompletion && _iterator.return != null) {
yield _iteratorError.return();
yield _iterator.return();
}
} finally{
if (_didIteratorError) {
@ -96,7 +96,7 @@ function _f2() {
} finally{
try {
if (_iteratorAbruptCompletion2 && _iterator2.return != null) {
yield _iteratorError2.return();
yield _iterator2.return();
}
} finally{
if (_didIteratorError2) {

View File

@ -48,7 +48,7 @@ function _f1() {
break;
}
_ctx.next = 22;
return _iteratorError.return();
return _iterator.return();
case 22:
_ctx.prev = 22;
if (!_didIteratorError) {
@ -96,7 +96,7 @@ function _f1() {
break;
}
_ctx.next = 48;
return _iteratorError1.return();
return _iterator1.return();
case 48:
_ctx.prev = 48;
if (!_didIteratorError1) {
@ -186,7 +186,7 @@ function _f2() {
break;
}
_ctx.next = 22;
return _iteratorError.return();
return _iterator.return();
case 22:
_ctx.prev = 22;
if (!_didIteratorError) {
@ -234,7 +234,7 @@ function _f2() {
break;
}
_ctx.next = 48;
return _iteratorError2.return();
return _iterator2.return();
case 48:
_ctx.prev = 48;
if (!_didIteratorError2) {

View File

@ -730,7 +730,7 @@ fn handle_await_for(stmt: &mut Stmt, is_async_generator: bool) {
delegate: false,
arg: Some(Box::new(Expr::Call(CallExpr {
span: DUMMY_SP,
callee: iterator_error
callee: iterator
.clone()
.make_member(quote_ident!("return"))
.as_callee(),

View File

@ -2524,7 +2524,7 @@ test!(
} finally{
try {
if (_iteratorAbruptCompletion && _iterator.return != null) {
yield _iteratorError.return();
yield _iterator.return();
}
} finally{
if (_didIteratorError) {