PR Feedback

This commit is contained in:
Ron Buckton
2017-06-08 11:27:35 -07:00
parent 6bbacb64ce
commit 80a7716117
5 changed files with 123 additions and 11 deletions

View File

@@ -12744,9 +12744,11 @@ namespace ts {
if (declaration.type) {
return getTypeFromTypeNode(declaration.type);
}
const jsDocType = isInJavaScriptFile(declaration) && getTypeForDeclarationFromJSDocComment(declaration);
if (jsDocType) {
return jsDocType;
if (isInJavaScriptFile(declaration)) {
const jsDocType = getTypeForDeclarationFromJSDocComment(declaration);
if (jsDocType) {
return jsDocType;
}
}
if (declaration.kind === SyntaxKind.Parameter) {
const type = getContextuallyTypedParameterType(<ParameterDeclaration>declaration);

View File

@@ -2625,13 +2625,11 @@ namespace ts {
if (accessor && accessor.parameters.length > 0) {
const hasThis = accessor.parameters.length === 2 && parameterIsThisKeyword(accessor.parameters[0]);
const parameter = accessor.parameters[hasThis ? 1 : 0];
if (parameter) {
if (parameter.type) {
return parameter.type;
}
if (includeJSDocType && parameter.flags & NodeFlags.JavaScriptFile) {
return getJSDocType(parameter);
}
if (parameter.type) {
return parameter.type;
}
if (includeJSDocType && parameter.flags & NodeFlags.JavaScriptFile) {
return getJSDocType(parameter);
}
}
}