Skip to content

Conversation

@ghost
Copy link

@ghost ghost commented Jun 25, 2018

No need to append to an existing array as this function is only called once on a freshly created node.

@ghost ghost requested a review from sandersn June 25, 2018 17:51
@ghost ghost force-pushed the addJSDocComment branch from f775dec to 8012c98 Compare June 25, 2018 17:52
Copy link
Member

@sandersn sandersn left a comment

Choose a reason for hiding this comment

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

Looks good, although I think a new assert would be good.

}
}

const jsDoc = mapDefined(getJSDocCommentRanges(node, sourceFile.text), comment => JSDocParser.parseJSDocComment(node, comment.pos, comment.end - comment.pos));
Copy link
Member

Choose a reason for hiding this comment

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

to make sure people don't misuse this function, can you Debug.assert(!node.jsDoc) ?

@ghost
Copy link
Author

ghost commented Jun 25, 2018

Test failure fixed by #25199

@ghost ghost merged commit 4c326b2 into master Jun 25, 2018
@ghost ghost deleted the addJSDocComment branch June 25, 2018 18:36
@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 21, 2025
This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant