Skip to content

fix: assign trailing comment to ObjectProperty only when inside an ObjectExpression#10292

Merged
existentialism merged 1 commit intobabel:masterfrom
JLHwung:fix-10230
Aug 13, 2019
Merged

fix: assign trailing comment to ObjectProperty only when inside an ObjectExpression#10292
existentialism merged 1 commit intobabel:masterfrom
JLHwung:fix-10230

Conversation

@JLHwung
Copy link
Copy Markdown
Contributor

@JLHwung JLHwung commented Aug 1, 2019

Q                       A
Fixed Issues? Fixes #10230
Patch: Bug Fix? Yes
Major: Breaking Change?
Minor: New Feature?
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes?
License MIT

This is a follow up to babel/babylon#478.

When assigning tailing comment to an ObjectProperty, we should ensure the comment is inside the ObjectExpression, otherwise we would incorrectly assign a trailing comment of ObjectExpression, meanwhile the leading comment of subsequence statements, to this ObjectProperty.

@JLHwung JLHwung force-pushed the fix-10230 branch 2 times, most recently from 81f4ab4 to d58b88e Compare August 1, 2019 19:21
@JLHwung JLHwung added area: comments pkg: parser PR: Bug Fix 🐛 A type of pull request used for our changelog categories labels Aug 1, 2019
@babel-bot
Copy link
Copy Markdown
Collaborator

babel-bot commented Aug 1, 2019

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

@babel-bot
Copy link
Copy Markdown
Collaborator

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

@existentialism existentialism merged commit 75090f1 into babel:master Aug 13, 2019
@JLHwung JLHwung deleted the fix-10230 branch August 13, 2019 19:16
@lock lock bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Nov 12, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Nov 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area: comments outdated A closed issue/PR that is archived due to age. Recommended to make a new issue pkg: parser PR: Bug Fix 🐛 A type of pull request used for our changelog categories

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Comments unexpectedly showing up in trailingComments as opposed to leadingComments in some cases.

4 participants