-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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): Hoist arguments
in object method while lowering async functions
#10167
Conversation
During my investigation of this issue, I discovered that esbuild employs a more streamlined approach compared to Babel. Rather than hoisting Here's a code example demonstrating this approach: var foo = {
bar(_0) {
return __async(this, arguments, function* ({ name }) {
console.log("arguments.length", arguments.length);
});
}
}; This optimization eliminates the hoisting process for Maybe in another PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changeset bot is refusing to work 🤣
I'll add them manually
Why isn't this implemented using |
🦋 Changeset detectedLatest commit: 96ef752 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Oh I forgot the comment. @magic-akari Is there a particular reason? |
Are you referring to esbuild's approach? |
Do you mean |
Sorry, you are right. Now it uses the |
That's good.
I don't like apply and bind. IIRC they may introduce some nasty problems. |
Related issue:
arguments
is not transform correct in async function #10149