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
Incorrect rest operator behavior for async arrow function #3077
Comments
I hope I didn't duplicate an issue. |
I can confirm that I am experiencing this in Babel 6.3.15, being used under webpack.
When viewing the transpiled code, the short arguments-to-array loop in fooSync references
This bug is still reproducible on the latest babel-core with the latest "syntax-async-functions" and "transform-async-to-generator" plugins. It does not only affect rest params, but also default parameters. Input code:
Output:
The |
Bug is reproducible in Babel 5.x REPL. I wasn't able to test it with Babel 6, sorry.
Code example
In first function everything is good: the result of
composeSync
will be an arrow function which uses rest operator for getting all arguments.In the
composeAsync
function behavior is different (maybe because of regenerator's runtime?): arguments for rest operator are taken from outer scope, fromcomposeAsync
function.Any thoughts?
The text was updated successfully, but these errors were encountered: