Skip to content

Two JSdoc parsing fixes #22705

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

Merged
merged 6 commits into from
Mar 20, 2018
Merged

Two JSdoc parsing fixes #22705

merged 6 commits into from
Mar 20, 2018

Conversation

sandersn
Copy link
Member

  1. Correctly parse *=. Previously parseNonArrayType missed it because the scanner produces a single AsteriskEqualsToken for it.
  2. Allow non-standard use of backticks around names in @param tags. For example:
/** @param {number} `a` some kind of number */
function f(a) { ... }

Fixes #22413

@sandersn sandersn requested review from weswigham and a user March 19, 2018 23:20
@sandersn
Copy link
Member Author

The CI failure is some whitespace lint.

@weswigham
Copy link
Member

nit: Could you add a test for var a = /* @type *= */(null) (or somewhere else we parse an unbracketed jsdoc type, if I'm misremembering and we never allowed that), just so we know it doesn't crash?

@sandersn
Copy link
Member Author

Good idea, since we went to make sure that we're getting tokens from the main scanner instead of the jsdoc one. Done.

@sandersn sandersn merged commit ab8233c into master Mar 20, 2018
@sandersn sandersn deleted the fix-jsdoc-parsing branch March 20, 2018 16:23
@microsoft microsoft locked and limited conversation to collaborators Jul 25, 2018
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.

2 participants