Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(es/compat): counteract unrolling of awaited async arrays in generator #5965

Merged
merged 7 commits into from
Sep 27, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ function _func() {
p
];
case 1:
b = fn.apply(void 0, _tmp.concat(_state.sent(), a));
b = fn.apply(void 0, _tmp.concat([
_state.sent()
], [
a
]));
after();
return [
2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ function _func() {
p
];
case 1:
b = _.apply(o, _tmp.concat(_state.sent(), a));
b = _.apply(o, _tmp.concat([
_state.sent()
], [
a
]));
after();
return [
2
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
//// [awaitCallExpression9_es5.ts]
import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
function func() {
return _func.apply(this, arguments);
}
function _func() {
_func = _async_to_generator(function() {
var b, _, _tmp;
return _ts_generator(this, function(_state) {
switch(_state.label){
case 0:
before();
_ = o.fn;
_tmp = [
a
];
return [
4,
p
];
case 1:
b = _.apply(o, _tmp.concat([
_state.sent()
], [
a
]));
after();
return [
2
];
}
});
});
return _func.apply(this, arguments);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
//// [awaitCallExpression9_es5.ts]