TypeScript/tests/cases/conformance/jsdoc
Nathan Shively-Sanders d892fd408f
Fix expando handling in getTypeReferenceType (#34712)
* 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
2019-10-24 13:12:44 -07:00
..
declarations Implement declaration emit for accessors in the js declaration emitter (#33649) 2019-09-30 11:09:35 -07:00
assertionsAndNonReturningFunctions.ts Add tests 2019-09-20 17:17:39 -07:00
callbackCrossModule.ts Add callback tag, with type parameters (#23947) 2018-05-17 09:28:11 -07:00
callbackTag1.ts Add callback tag, with type parameters (#23947) 2018-05-17 09:28:11 -07:00
callbackTag2.ts Add callback tag, with type parameters (#23947) 2018-05-17 09:28:11 -07:00
callbackTag3.ts Add callback tag, with type parameters (#23947) 2018-05-17 09:28:11 -07:00
callbackTagNamespace.ts Disallow nested object param syntax in callback tag (#24392) 2018-05-24 15:11:33 -07:00
callOfPropertylessConstructorFunction.ts Bind @class in the right place -- bindWorker not bindChildrenWorker (#34575) 2019-10-18 14:13:14 -07:00
checkExportsObjectAssignProperty.ts Add new special assignment kinds for recognizing Object.defineProperty calls (#27208) 2018-10-19 14:31:55 -07:00
checkExportsObjectAssignPrototypeProperty.ts Add new special assignment kinds for recognizing Object.defineProperty calls (#27208) 2018-10-19 14:31:55 -07:00
checkJsdocOnEndOfFile.ts Check EOF token to get errors for JSDoc (#28000) 2018-10-19 16:23:34 -07:00
checkJsdocParamOnVariableDeclaredFunctionExpression.ts
checkJsdocParamTag1.ts
checkJsdocReturnTag1.ts
checkJsdocReturnTag2.ts
checkJsdocTypedefInParamTag1.ts
checkJsdocTypeTag1.ts
checkJsdocTypeTag2.ts
checkJsdocTypeTag3.ts
checkJsdocTypeTag4.ts Js/check type tags (#24967) 2018-06-14 13:11:52 -07:00
checkJsdocTypeTag5.ts Get return type from @type tag (#25580) 2018-07-12 10:49:41 -07:00
checkJsdocTypeTag6.ts Stricter test that JSDoc @type tag matches function signature (#25615) 2018-07-12 14:02:02 -07:00
checkJsdocTypeTagOnObjectProperty1.ts
checkJsdocTypeTagOnObjectProperty2.ts
checkObjectDefineProperty.ts Add new special assignment kinds for recognizing Object.defineProperty calls (#27208) 2018-10-19 14:31:55 -07:00
checkOtherObjectAssignProperty.ts Add new special assignment kinds for recognizing Object.defineProperty calls (#27208) 2018-10-19 14:31:55 -07:00
constructorTagOnClassConstructor.ts Only functions can be constructor functions (#27369) 2018-10-08 10:14:31 -07:00
constructorTagOnObjectLiteralMethod.ts Add getEffectiveConstructSignatures (#27561) 2018-10-15 12:47:57 -07:00
enumTag.ts Use nextToken() after parsing a tag name so we can parse type keywords (#26915) 2018-09-13 15:49:06 -07:00
enumTagCircularReference.ts Fix enum tag circular references (#27161) 2018-09-17 16:06:17 -07:00
enumTagImported.ts In JSDoc, resolve import types as values too (#26066) 2018-07-31 11:07:06 -07:00
enumTagOnExports.ts Bind typedef/enum on all assignment decl kinds (#33240) 2019-09-04 13:11:03 -07:00
enumTagOnExports2.ts Bind typedef/enum on all assignment decl kinds (#33240) 2019-09-04 13:11:03 -07:00
enumTagUseBeforeDefCrash.ts Fix crash in use-before-def checking of enum tag (#27350) (#27354) 2018-09-26 09:05:18 -07:00
extendsTag1.ts In JS, always check the extends tag of a class before its heritage clause (#25111) 2018-06-20 16:28:30 -07:00
extendsTagEmit.ts Always check extends clause of classes 2019-04-05 16:37:27 -07:00
jsdocAugments_errorInExtendsExpression.ts In JS, always check the extends tag of a class before its heritage clause (#25111) 2018-06-20 16:28:30 -07:00
jsdocAugments_nameMismatch.ts In JS, always check the extends tag of a class before its heritage clause (#25111) 2018-06-20 16:28:30 -07:00
jsdocAugments_noExtends.ts In JS, always check the extends tag of a class before its heritage clause (#25111) 2018-06-20 16:28:30 -07:00
jsdocAugments_notAClass.ts In JS, always check the extends tag of a class before its heritage clause (#25111) 2018-06-20 16:28:30 -07:00
jsdocAugments_qualifiedName.ts In JS, always check the extends tag of a class before its heritage clause (#25111) 2018-06-20 16:28:30 -07:00
jsdocAugments_withTypeParameter.ts In JS, always check the extends tag of a class before its heritage clause (#25111) 2018-06-20 16:28:30 -07:00
jsdocAugmentsMissingType.ts In JS, always check the extends tag of a class before its heritage clause (#25111) 2018-06-20 16:28:30 -07:00
jsdocBindingInUnreachableCode.ts Fix parent points in unreachable code (#27400) (#27406) 2018-09-28 08:31:56 -07:00
jsdocDisallowedInTypescript.ts Parse JSDoc ...T and T= only at top-level JSDoc (#22661) 2018-03-16 16:08:42 -07:00
jsdocFunctionType.ts Fixes #26128 - signature comp for jsdoc @class. (#26160) 2018-08-14 13:35:51 -07:00
jsdocImportType.ts module.exports = Entity is an alias, just like export = Entity (#23570) 2018-04-23 15:24:31 -07:00
jsdocImportType2.ts module.exports = Entity is an alias, just like export = Entity (#23570) 2018-04-23 15:24:31 -07:00
jsdocImportTypeReferenceToClassAlias.ts getTypeFromJSDocValueReference: handle import types (#34683) 2019-10-23 15:53:38 -07:00
jsdocIndexSignature.ts
jsdocLiteral.ts
jsdocNeverUndefinedNull.ts
jsdocParamTag2.ts JSDoc:positional matching of destructured params (#23307) 2018-04-10 12:48:35 -07:00
jsdocParamTagTypeLiteral.ts checkJs: require JSDoc type argument for Array, Object, and Promise in noImplicitAny (#32829) 2019-08-16 12:41:09 -07:00
jsdocParseBackquotedParamName.ts Two JSdoc parsing fixes (#22705) 2018-03-20 09:23:08 -07:00
jsdocParseDotDotDotInJSDocFunction.ts Improve behaviour of ... inside JSDoc functions (#22809) 2018-03-22 16:17:16 -07:00
jsdocParseErrorsInTypescript.ts
jsdocParseHigherOrderFunction.ts Fix parsing of parenthesized JSDoc parameters (#25799) 2018-07-19 12:50:36 -07:00
jsdocParseMatchingBackticks.ts JSDoc:Treat tokens between backticks as comments 2019-06-26 16:04:46 -07:00
jsdocParseParenthesizedJSDocParameter.ts Fix parsing of parenthesized JSDoc parameters (#25799) 2018-07-19 12:50:36 -07:00
jsdocParseStarEquals.ts Two JSdoc parsing fixes (#22705) 2018-03-20 09:23:08 -07:00
jsdocPostfixEqualsAddsOptionality.ts JSDoc ?Type adds optionality to parameters (#22646) 2018-03-16 13:28:24 -07:00
jsdocPrefixPostfixParsing.ts Parse JSDoc ...T and T= only at top-level JSDoc (#22661) 2018-03-16 16:08:42 -07:00
jsdocPrototypePropertyAccessWithType.ts Don't crash on property access with type (#25170) 2018-06-25 11:25:52 -07:00
jsdocReturnTag1.ts
jsdocTemplateClass.ts Template tag allows specification of constraints (#24600) 2018-06-04 11:42:46 -07:00
jsdocTemplateConstructorFunction.ts Template tag allows specification of constraints (#24600) 2018-06-04 11:42:46 -07:00
jsdocTemplateConstructorFunction2.ts Constructor functions as classes (#32944) 2019-08-19 14:12:53 -07:00
jsdocTemplateTag.ts Prototype-property assignment:fix name resolution crash (#23680) 2018-04-25 13:59:40 -07:00
jsdocTemplateTag2.ts Add callback tag, with type parameters (#23947) 2018-05-17 09:28:11 -07:00
jsdocTemplateTag3.ts Template tag allows specification of constraints (#24600) 2018-06-04 11:42:46 -07:00
jsdocTemplateTag4.ts Fixes for type parameter name resolution in JS (#26830) 2018-09-04 14:47:18 -07:00
jsdocTemplateTag5.ts Fixes for type parameter name resolution in JS (#26830) 2018-09-04 14:47:18 -07:00
jsdocTwoLineTypedef.ts
jsdocTypeDefAtStartOfFile.ts
jsdocTypeFromChainedAssignment.ts Improve binding and jsdoc of chained special js assignments (#23038) 2018-04-02 09:47:01 -07:00
jsdocTypeFromChainedAssignment2.ts No error for require, module.exports or exports in Javascript (#23743) 2018-04-30 15:47:59 -07:00
jsdocTypeFromChainedAssignment3.ts Fix factorial jsdoc search:chained assignments (#23115) 2018-04-04 08:57:13 -07:00
jsdocTypeReferenceExports.ts Fix name resolution of exports in JS (#27394) 2018-10-08 13:01:14 -07:00
jsdocTypeReferenceToMergedClass.ts Fix expando handling in getTypeReferenceType (#34712) 2019-10-24 13:12:44 -07:00
jsdocTypeReferenceToValue.ts Resolve more jsdoc value references as types (#34515) 2019-10-17 11:21:34 -07:00
jsdocTypeReferenceUseBeforeDef.ts Fix bogus use before def in jsdoc (#25532) 2018-07-10 08:33:19 -07:00
jsdocTypeTag.ts Fix type when annotated with a JSDoc function type (#22692) 2018-03-19 16:00:45 -07:00
jsdocTypeTagCast.ts
jsdocTypeTagParameterType.ts Fix type when annotated with a JSDoc function type (#22692) 2018-03-19 16:00:45 -07:00
jsdocTypeTagRequiredParameters.ts Fix type when annotated with a JSDoc function type (#22692) 2018-03-19 16:00:45 -07:00
moduleExportsElementAccessAssignment.ts Allow special element access assignments to create declarations (#33537) 2019-09-30 15:08:44 -05:00
moduleExportsElementAccessAssignment2.ts Detect unbindable exports before setting CommonJS module indicator (#33784) 2019-10-04 11:52:38 -05:00
noAssertForUnparseableTypedefs.ts No assert for nameless typedefs (#26695) 2018-08-27 14:12:14 -07:00
noDuplicateJsdoc1.ts No dupe jsdoc for assignment inside an initializer (#24973) 2018-06-14 15:32:10 -07:00
paramTagBracketsAddOptionalUndefined.ts
paramTagNestedWithoutTopLevelObject.ts Minor refactor in paramTagNestedWithoutTopLevelObject.ts 2019-01-10 14:05:10 -08:00
paramTagNestedWithoutTopLevelObject2.ts Add more tests for qualified name param without top level object error 2019-01-10 15:04:16 -08:00
paramTagNestedWithoutTopLevelObject3.ts Add more tests for qualified name param without top level object error 2019-01-10 15:04:16 -08:00
paramTagNestedWithoutTopLevelObject4.ts Add more tests for qualified name param without top level object error 2019-01-10 15:04:16 -08:00
paramTagOnCallExpression.ts
paramTagOnFunctionUsingArguments.ts
paramTagTypeResolution.ts Fix jsdoc type resolution [merge to master] (#24204) 2018-05-17 10:46:10 -07:00
paramTagWrapping.ts Skip whitespace or asterisk in JSDoc param type and name (#26067) 2018-08-16 16:16:09 -07:00
returnTagTypeGuard.ts Allow type predicates in JSDoc (#26343) 2018-08-10 15:31:39 -07:00
syntaxErrors.ts
thisTag1.ts Support @this tags (#24927) 2018-06-13 10:11:12 -07:00
tsNoCheckForTypescript.ts Respect //@ts-nocheck in TS files (#33383) 2019-09-27 12:06:05 -07:00
typedefCrossModule.ts Always export typedefs (#23723) 2018-04-30 14:55:26 -07:00
typedefCrossModule2.ts Always export typedefs (#23723) 2018-04-30 14:55:26 -07:00
typedefCrossModule3.ts Always export typedefs (#23723) 2018-04-30 14:55:26 -07:00
typedefCrossModule4.ts Always export typedefs (#23723) 2018-04-30 14:55:26 -07:00
typedefCrossModule5.ts Adds related spans and error grouping for duplicate identifier errors (#25328) 2018-07-02 10:47:52 -07:00
typedefInnerNamepaths.ts Fix crash when binding jsdoc-style inner namepaths (#25106) 2018-06-21 10:01:39 -07:00
typedefMultipleTypeParameters.ts Js/check type tags (#24967) 2018-06-14 13:11:52 -07:00
typedefTagNested.ts Parse nested prop and param tags the same way (#25139) 2018-06-21 16:12:55 -07:00
typedefTagTypeResolution.ts Fix jsdoc type resolution [merge to master] (#24204) 2018-05-17 10:46:10 -07:00
typedefTagWrapping.ts Skip asterisks after newline when parsing JSDoc types (#26528) 2018-09-04 15:41:08 -07:00
typeParameterExtendsUnionConstraintDistributed.ts Hoist and distribute type parameter constraints over type parameters … (#33453) 2019-09-23 16:52:03 -07:00
typeTagCircularReferenceOnConstructorFunction.ts Report circular JSDoc type references (#27404) 2018-10-08 08:56:29 -07:00
typeTagModuleExports.ts Better checking of assignment declarations (#28387) 2018-11-15 08:46:11 -08:00
typeTagPrototypeAssignment.ts Better checking of assignment declarations (#28387) 2018-11-15 08:46:11 -08:00
typeTagWithGenericSignature.ts Get [type] parameter types from @type tag (#26694) 2018-08-27 16:52:35 -07:00