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
Don't convert line comments containing */
to block comments
#15135
Conversation
@@ -10,7 +10,6 @@ export function _params( | |||
this.token("("); | |||
this._parameters(node.params, node); | |||
this.token(")"); | |||
this._noLineTerminator = true; |
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.
This is the fix, can you confirm it? I'm not sure about the purpose here.
@nicolo-ribaudo
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.
In arrow functions, )
cannot be followed by a newline.
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.
Probably it doesn't matter because inner comments in arrow functions would already be printer earlier.
if (this._noLineTerminator && HAS_NEWLINE.test(comment.value)) { | ||
const noLineTerminator = this._noLineTerminator; | ||
|
||
if ( | ||
noLineTerminator && | ||
(HAS_NEWLINE.test(comment.value) || | ||
HAS_BlOCK_COMMENT_END.test(comment.value)) | ||
) { |
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.
Here is the fix for the root cause, see the test.
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/53362/ |
*/
to block comments
regression: #15118