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
Set correct async/generator in IIFE for params #11346
Set correct async/generator in IIFE for params #11346
Conversation
} | ||
|
||
function g() { | ||
let a = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1; |
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.
The default expression could actually throw a sync error, which needs to be caught sand turned into a rejected promise.
packages/babel-plugin-transform-parameters/test/fixtures/regression/scope-gen-async/output.js
Show resolved
Hide resolved
@ulrichb This should fix your error about |
@nicolo-ribaudo Thank you very much! |
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.
Not related to this PR, but
class C {
p = async (a = 1) => {
var a = await a;
return a;
}
}
will fail with Unable to transform arrow inside class property
given the following settings
{
"plugins": [
"transform-parameters",
"syntax-class-properties"
]
}
May leave it as-is since practically no one will leave class properties untranspiled but only parameters.
The problem is that we don't have a place where we can put a |
Current behavior: