Skip to content

Commit

Permalink
review
Browse files Browse the repository at this point in the history
  • Loading branch information
liuxingbaoyu committed May 17, 2024
1 parent cf55283 commit 3191dbf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions packages/babel-helpers/src/helpers-generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,10 @@ const helpers: Record<string, Helper> = {
"7.0.0-beta.0",
'import OverloadYield from"OverloadYield";export default function _awaitAsyncGenerator(e){return new OverloadYield(e,0)}',
),
// size: 267, gzip size: 201
// size: 270, gzip size: 199
callAsync: helper(
"7.24.4",
'export default function _callAsync(t,e,n){return new Promise((function(r,i){function step(t,e){try{var n=o[t](e),c=n.value}catch(t){return void i(t)}n.done?r(c):Promise.resolve(c).then(s,a)}var o=t.apply(e,n),s=step.bind(this,"next"),a=step.bind(this,"throw");s()}))}',
"export default function _callAsync(t,e,n){return new Promise((function(r,i){function step(t,e){try{var n=(t?o.next:o.throw)(e),c=n.value}catch(t){return void i(t)}n.done?r(c):Promise.resolve(c).then(s,a)}var o=t.apply(e,n),s=step.bind(this,1),a=step.bind(this,0);s()}))}",
),
// size: 96, gzip size: 107
callSkipFirstGeneratorNext: helper(
Expand Down
8 changes: 4 additions & 4 deletions packages/babel-helpers/src/helpers/callAsync.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

export default function _callAsync(fn, self, args) {
return new Promise(function (resolve, reject) {
function step(key, arg) {
function step(happy, arg) {
try {
var info = gen[key](arg);
var info = (happy ? gen.next : gen.throw)(arg);
var value = info.value;
} catch (error) {
reject(error);
Expand All @@ -18,8 +18,8 @@ export default function _callAsync(fn, self, args) {
}
}
var gen = fn.apply(self, args),
_next = step.bind(this, "next"),
_throw = step.bind(this, "throw");
_next = step.bind(this, 1),
_throw = step.bind(this, 0);

_next();
});
Expand Down

0 comments on commit 3191dbf

Please sign in to comment.