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 location for optional params in arrow functions #9998
Conversation
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/10825/ |
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.
We could throw in finishNode
if it is already finished (maybe only when running out tests).
Oh yeah of course any dependency in the packages themself. Seems the core-js (3.1.0) release broke our tests /cc @zloirock |
@danez |
Also, seems the replacing of |
…eration of `core-js-compat/entries` and backward `preset-env` compatibility babel/babel#9998 (comment)
This ensures we only add +1 to the location when there is an optional parameter. In TS we currently were calling
this.finishNode()
even if no question mark was present, which caused comments being processed twice and as a result comments were disappearing. Not sure why though, I didn't want to dive into the comments attachment algorithm.It also made certain expressions locations wrong.
The numeric literal would include one of the closing parenthesis in its location.
I also made sure that the flow plugin does the same (include the question mark) as the typescript plugin.