fix: assign comment to ObjectProperty only when inside an ObjectExpression (#10292)
Fixes #10230
This commit is contained in:
@@ -91,7 +91,7 @@ export default class CommentsParser extends BaseParser {
|
||||
const lastComment = last(this.state.leadingComments);
|
||||
|
||||
if (firstChild.type === "ObjectProperty") {
|
||||
if (lastComment.start >= node.start) {
|
||||
if (lastComment.start >= node.start && lastComment.end <= node.end) {
|
||||
if (this.state.commentPreviousNode) {
|
||||
for (j = 0; j < this.state.leadingComments.length; j++) {
|
||||
if (
|
||||
|
||||
Reference in New Issue
Block a user