Skip to content

Fix assert in getjsdochost - #23575

Merged
Nathan Shively-Sanders (sandersn) merged 3 commits into
masterfrom
fix-assert-in-getjsdochost
Apr 20, 2018
Merged

Nathan Shively-Sanders (sandersn) merged 3 commits into
masterfrom
fix-assert-in-getjsdochost

Conversation

@sandersn

Copy link
Copy Markdown
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
Nathan Shively-Sanders (sandersn) deleted the fix-assert-in-getjsdochost branch April 20, 2018 17:42
@microsoft 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