Skip to content

Ignore newline and asterisk when parsing JSDoc typedef #26775

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 1 commit into from
Aug 30, 2018

Conversation

tschaub
Copy link
Contributor

@tschaub tschaub commented Aug 30, 2018

This makes it possible to typecheck JSDoc types like this:

/** 
 * @typedef {function(string): boolean}
 * MyType
 */

/**
 * @param {MyType} func The function to call.
 * @param {string} arg The argument to call it with.
 * @returns {boolean} The return.
 */
function callIt(func, arg) {
  return func(arg);
}

Fixes #26774.

See also #26067.

@sandersn sandersn merged commit 20a2b0c into microsoft:master Aug 30, 2018
@tschaub tschaub deleted the skip-more-asterisks branch August 30, 2018 17:05
@tschaub
Copy link
Contributor Author

tschaub commented Aug 30, 2018

Thanks for the quick review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants