mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-07 05:41:22 -06:00
Merge pull request #6709 from RyanCavanaugh/fix6662
Don't crash when return type jsdoc tag is malformed
This commit is contained in:
commit
bd3e9f262a
@ -10380,9 +10380,11 @@ namespace ts {
|
||||
|
||||
function getReturnTypeFromJSDocComment(func: SignatureDeclaration | FunctionDeclaration): Type {
|
||||
const returnTag = getJSDocReturnTag(func);
|
||||
if (returnTag) {
|
||||
if (returnTag && returnTag.typeExpression) {
|
||||
return getTypeFromTypeNode(returnTag.typeExpression.type);
|
||||
}
|
||||
|
||||
return undefined;
|
||||
}
|
||||
|
||||
function createPromiseType(promisedType: Type): Type {
|
||||
|
||||
20
tests/cases/fourslash/getJavaScriptQuickInfo7.ts
Normal file
20
tests/cases/fourslash/getJavaScriptQuickInfo7.ts
Normal file
@ -0,0 +1,20 @@
|
||||
/// <reference path="fourslash.ts" />
|
||||
|
||||
// @allowNonTsExtensions: true
|
||||
// @Filename: file.js
|
||||
//// /**
|
||||
//// * This is a very cool function that is very nice.
|
||||
//// * @returns something
|
||||
//// * @param p anotherthing
|
||||
//// */
|
||||
//// function a1(p) {
|
||||
//// try {
|
||||
//// throw new Error('x');
|
||||
//// } catch (x) { x--; }
|
||||
//// return 23;
|
||||
//// }
|
||||
////
|
||||
//// x - /**/a1()
|
||||
|
||||
goTo.marker();
|
||||
verify.quickInfoExists();
|
||||
Loading…
x
Reference in New Issue
Block a user