Skip to content

Fix assert in getjsdochost #23575

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 3 commits into from
Apr 20, 2018
Merged

Fix assert in getjsdochost #23575

merged 3 commits into from
Apr 20, 2018

Conversation

sandersn
Copy link
Member

After #23511, the assert in getJSDocHost throws when checking a type reference in a jsdoc type literal:

function PluginFunction() {
}
/**
 * @param {object} options Options for the profiled fn.
 // assert here: this @param's parent is the options tag, not the entire comment
 * @param {PluginFunction} options.fn Plugin function
 * @returns {*} Chainable hooked function.
 */
const makeNewProfiledTapFn = ({ fn }) => {
};

The problem is that getJSDocHost doesn't work with param tags that are nested inside a jsdoc type literal. This PR makes getJSDocHost walk up through jsdoc type literals before getting the host.

Found by compiling webpack with typescript from master.

Fixes #23574

@sandersn sandersn requested review from mhegazy and a user April 20, 2018 17:22
@sandersn sandersn merged commit e65681a into master Apr 20, 2018
@sandersn sandersn deleted the fix-assert-in-getjsdochost branch April 20, 2018 17:42
@microsoft microsoft locked and limited conversation to collaborators Jul 30, 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