d892fd408f
* Fix expando handling in getTypeReferenceType getExpandoSymbol looks for the initialiser of a symbol when it is an expando value (IIFEs, function exprs, class exprs and empty object literals) and returns the symbol. Previously, however, it returned the symbol of the initialiser without merging with the declaration symbol itself. This missed, in particular, the prototype assignment in the following pattern: ```js var x = function x() { this.y = 1 } x.prototype = { z() { } } /** @type {x} */ var xx; xx.z // missed! ``` getJSDocValueReference had weird try-again code that relied on calling getTypeOfSymbol, which *does* correctly merge the symbols. This PR re-removes that code and instead makes getExpandoSymbol call mergeJSSymbols itself. * Remove extra newline
15 lines
336 B
TypeScript
15 lines
336 B
TypeScript
// https://github.com/microsoft/TypeScript/issues/34685
|
|
// @noEmit: true
|
|
// @allowJs: true
|
|
// @checkJs: true
|
|
|
|
// @Filename: jsdocTypeReferenceToMergedClass.js
|
|
var Workspace = {}
|
|
/** @type {Workspace.Project} */
|
|
var p;
|
|
p.isServiceProject()
|
|
|
|
Workspace.Project = function wp() { }
|
|
Workspace.Project.prototype = {
|
|
isServiceProject() {}
|
|
}
|