@@ -4239,7 +4239,7 @@ namespace ts {
4239
4239
return addOptionality(declaredType, /*optional*/ declaration.questionToken && includeOptionality);
4240
4240
}
4241
4241
4242
- if ((noImplicitAny || declaration.flags & NodeFlags.JavaScriptFile ) &&
4242
+ if ((noImplicitAny || isInJavaScriptFile( declaration) ) &&
4243
4243
declaration.kind === SyntaxKind.VariableDeclaration && !isBindingPattern(declaration.name) &&
4244
4244
!(getCombinedModifierFlags(declaration) & ModifierFlags.Export) && !isInAmbientContext(declaration)) {
4245
4245
// If --noImplicitAny is on or the declaration is in a Javascript file,
@@ -4493,7 +4493,7 @@ namespace ts {
4493
4493
if (declaration.kind === SyntaxKind.ExportAssignment) {
4494
4494
return links.type = checkExpression((<ExportAssignment>declaration).expression);
4495
4495
}
4496
- if (declaration.flags & NodeFlags.JavaScriptFile && declaration.kind === SyntaxKind.JSDocPropertyTag && (<JSDocPropertyTag>declaration).typeExpression) {
4496
+ if (isInJavaScriptFile( declaration) && declaration.kind === SyntaxKind.JSDocPropertyTag && (<JSDocPropertyTag>declaration).typeExpression) {
4497
4497
return links.type = getTypeFromTypeNode((<JSDocPropertyTag>declaration).typeExpression.type);
4498
4498
}
4499
4499
// Handle variable, parameter or property
@@ -4552,7 +4552,7 @@ namespace ts {
4552
4552
const getter = getDeclarationOfKind<AccessorDeclaration>(symbol, SyntaxKind.GetAccessor);
4553
4553
const setter = getDeclarationOfKind<AccessorDeclaration>(symbol, SyntaxKind.SetAccessor);
4554
4554
4555
- if (getter && getter.flags & NodeFlags.JavaScriptFile ) {
4555
+ if (getter && isInJavaScriptFile( getter) ) {
4556
4556
const jsDocType = getTypeForDeclarationFromJSDocComment(getter);
4557
4557
if (jsDocType) {
4558
4558
return links.type = jsDocType;
@@ -6206,7 +6206,7 @@ namespace ts {
6206
6206
}
6207
6207
6208
6208
function isJSDocOptionalParameter(node: ParameterDeclaration) {
6209
- if (node.flags & NodeFlags.JavaScriptFile ) {
6209
+ if (isInJavaScriptFile( node) ) {
6210
6210
if (node.type && node.type.kind === SyntaxKind.JSDocOptionalType) {
6211
6211
return true;
6212
6212
}
0 commit comments