Address minor PR comment

This commit is contained in:
Yui T 2017-04-26 15:02:54 -07:00
parent a10e668c34
commit e50667e49e
3 changed files with 8 additions and 8 deletions

View file

@ -17134,10 +17134,11 @@ namespace ts {
case SyntaxKind.ElementAccessExpression: case SyntaxKind.ElementAccessExpression:
return checkIndexedAccess(<ElementAccessExpression>node); return checkIndexedAccess(<ElementAccessExpression>node);
case SyntaxKind.CallExpression: case SyntaxKind.CallExpression:
case SyntaxKind.NewExpression:
if ((<CallExpression>node).expression.kind === SyntaxKind.ImportKeyword) { if ((<CallExpression>node).expression.kind === SyntaxKind.ImportKeyword) {
return checkImportCallExpression(<ImportCall>node); return checkImportCallExpression(<ImportCall>node);
} }
// Fall through
case SyntaxKind.NewExpression:
return checkCallExpression(<CallExpression>node); return checkCallExpression(<CallExpression>node);
case SyntaxKind.TaggedTemplateExpression: case SyntaxKind.TaggedTemplateExpression:
return checkTaggedTemplateExpression(<TaggedTemplateExpression>node); return checkTaggedTemplateExpression(<TaggedTemplateExpression>node);

View file

@ -2416,7 +2416,7 @@ namespace ts {
if (token() === SyntaxKind.OpenParenToken || token() === SyntaxKind.LessThanToken) { if (token() === SyntaxKind.OpenParenToken || token() === SyntaxKind.LessThanToken) {
return parseSignatureMember(SyntaxKind.CallSignature); return parseSignatureMember(SyntaxKind.CallSignature);
} }
if (token() === SyntaxKind.NewKeyword && lookAhead(isStartOfConstructSignature)) { if (token() === SyntaxKind.NewKeyword && lookAhead(nextTokenIsOpenParenOrLessThan)) {
return parseSignatureMember(SyntaxKind.ConstructSignature); return parseSignatureMember(SyntaxKind.ConstructSignature);
} }
const fullStart = getNodePos(); const fullStart = getNodePos();
@ -2427,7 +2427,7 @@ namespace ts {
return parsePropertyOrMethodSignature(fullStart, modifiers); return parsePropertyOrMethodSignature(fullStart, modifiers);
} }
function isStartOfConstructSignature() { function nextTokenIsOpenParenOrLessThan() {
nextToken(); nextToken();
return token() === SyntaxKind.OpenParenToken || token() === SyntaxKind.LessThanToken; return token() === SyntaxKind.OpenParenToken || token() === SyntaxKind.LessThanToken;
} }
@ -5619,11 +5619,6 @@ namespace ts {
return nextToken() === SyntaxKind.OpenParenToken; return nextToken() === SyntaxKind.OpenParenToken;
} }
function nextTokenIsOpenParenOrLessThan() {
const next = nextToken();
return next === SyntaxKind.OpenParenToken || next === SyntaxKind.LessThanToken;
}
function nextTokenIsSlash() { function nextTokenIsSlash() {
return nextToken() === SyntaxKind.SlashToken; return nextToken() === SyntaxKind.SlashToken;
} }

View file

@ -1199,6 +1199,10 @@ namespace ts {
} }
function collectExternalModuleReferences(file: SourceFile): void { function collectExternalModuleReferences(file: SourceFile): void {
if (file.imports) {
return;
}
const isJavaScriptFile = isSourceFileJavaScript(file); const isJavaScriptFile = isSourceFileJavaScript(file);
const isExternalModuleFile = isExternalModule(file); const isExternalModuleFile = isExternalModule(file);
const isDtsFile = isDeclarationFile(file); const isDtsFile = isDeclarationFile(file);