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:
return checkIndexedAccess(<ElementAccessExpression>node);
case SyntaxKind.CallExpression:
case SyntaxKind.NewExpression:
if ((<CallExpression>node).expression.kind === SyntaxKind.ImportKeyword) {
return checkImportCallExpression(<ImportCall>node);
}
// Fall through
case SyntaxKind.NewExpression:
return checkCallExpression(<CallExpression>node);
case SyntaxKind.TaggedTemplateExpression:
return checkTaggedTemplateExpression(<TaggedTemplateExpression>node);

View file

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

View file

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