-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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 order of optional argument reordering #8376
Conversation
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/8694/ |
👍 for the additional validation. Can you also add a test which shows how the old behavior was wrong? Also, this bug probably needs to be fixed also in the other files in that folder. |
Woops, great catch. As @nicolo-ribaudo mentioned, we've got the same issue in
|
Good catch! After a quick search I found another one: babel/packages/babel-core/src/parse.js Line 27 in 98ff2ce
|
Added those ^, so we never added tests for async versions of those methods in #6780? |
Can merge now as well to fix the issue, but yeah we should figure out the tests too |
Caught this looking into an unrelated issue with AST transformations. Previously, if the optional
opts
parameter wasn't passed, the intent was to move the function it held into thecallback
parameter and null out theopts
param - but instead, it was nulling both.I'd actually suggest that
callback
is checked, too. Otherwise, erroneous downstream code could pass two functions (one for the callback and one, erroneously, for the options), thereby swallowing what should be a thrown exception about incorrect types.I can add that logic in if wanted.