Skip to content

Conversation

@liuxingbaoyu
Copy link
Member

@liuxingbaoyu liuxingbaoyu commented Dec 7, 2022

Q                       A
Fixed Issues? Fixes #15156, Fixes #11971, Closes #12558, Fixes #8507
Patch: Bug Fix? ?
Major: Breaking Change?
Minor: New Feature?
Tests Added + Pass?
Documentation PR Link
Any Dependency Changes?
License MIT

@liuxingbaoyu liuxingbaoyu added PR: Polish 💅 A type of pull request used for our changelog categories pkg: generator area: comments pkg: core labels Dec 7, 2022
Comment on lines 950 to +951
const printNewLines =
isBlockComment &&
skipNewLines !== COMMENT_SKIP_NEWLINE.ALL &&
!this._noLineTerminator;
skipNewLines !== COMMENT_SKIP_NEWLINE.ALL && !this._noLineTerminator;
Copy link
Member Author

@liuxingbaoyu liuxingbaoyu Dec 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of the changes of tests come from here, from testing changes it looks ok,

@babel-bot
Copy link
Collaborator

babel-bot commented Dec 7, 2022

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/53624/

@liuxingbaoyu
Copy link
Member Author

I don't think this is a good approach, but it shouldn't be too bad.🤷

@liuxingbaoyu liuxingbaoyu added PR: Bug Fix 🐛 A type of pull request used for our changelog categories and removed PR: Polish 💅 A type of pull request used for our changelog categories labels Dec 7, 2022
@liuxingbaoyu
Copy link
Member Author

Comment on lines 85 to 88
//
//

//
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could indicate a generator bug, since the input also contains this blank line, which was not printed correctly before, but that's not important.

@liuxingbaoyu liuxingbaoyu force-pushed the improve-transed-comments branch from fe3e5c0 to f19ba6e Compare December 8, 2022 01:38
Comment on lines +59 to +65
if (
lastNode.loc &&
node.loc &&
commentLoc &&
commentLoc.start.line - lastNode.loc.end.line >=
node.loc.start.line - commentLoc.end.line
) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Such a situation should not exist for @babel/parser, but I don't know what the parser plugin is, anyway, it doesn't matter if we add judgment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: comments pkg: core pkg: generator PR: Bug Fix 🐛 A type of pull request used for our changelog categories

Projects

None yet

2 participants