Skip to content

Commit 3a6838d

Browse files
author
Kanchalai Tanglertsampan
committed
Address PR
1 parent 70b01a9 commit 3a6838d

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

src/compiler/checker.ts

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22645,16 +22645,12 @@ namespace ts {
2264522645
return undefined;
2264622646

2264722647
case SyntaxKind.StringLiteral:
22648-
// import x = require("./mo/*gotToDefinitionHere*/d")
22649-
if (isExternalModuleImportEqualsDeclaration(node.parent.parent) && getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) {
22650-
return resolveExternalModuleName(node, <LiteralExpression>node);
22651-
}
22652-
// External module name in an import declaration
22653-
if ((node.parent.kind === SyntaxKind.ImportDeclaration || node.parent.kind === SyntaxKind.ExportDeclaration) && (<ImportDeclaration>node.parent).moduleSpecifier === node) {
22654-
return resolveExternalModuleName(node, <LiteralExpression>node);
22655-
}
22656-
if ((isInJavaScriptFile(node) && isRequireCall(node.parent, /*checkArgumentIsStringLiteral*/ false)) ||
22657-
isImportCall(node.parent)) {
22648+
// 1). import x = require("./mo/*gotToDefinitionHere*/d")
22649+
// 2). External module name in an import declaration
22650+
// 3). Dynamic import call or require in javascript
22651+
if ((isExternalModuleImportEqualsDeclaration(node.parent.parent) && getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) ||
22652+
((node.parent.kind === SyntaxKind.ImportDeclaration || node.parent.kind === SyntaxKind.ExportDeclaration) && (<ImportDeclaration>node.parent).moduleSpecifier === node) ||
22653+
((isInJavaScriptFile(node) && isRequireCall(node.parent, /*checkArgumentIsStringLiteral*/ false)) || isImportCall(node.parent))) {
2265822654
return resolveExternalModuleName(node, <LiteralExpression>node);
2265922655
}
2266022656
// falls through

0 commit comments

Comments
 (0)