Skip to content

Commit 5fa386e

Browse files
authored
Fix getSymbolAtLocation crash on export declaration (microsoft#1200)
1 parent 276ff5f commit 5fa386e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

internal/checker/checker.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30046,7 +30046,7 @@ func (c *Checker) getSymbolAtLocation(node *ast.Node, ignoreErrors bool) *ast.Sy
3004630046
// 3). Require in Javascript
3004730047
// 4). type A = import("./f/*gotToDefinitionHere*/oo")
3004830048
if (ast.IsExternalModuleImportEqualsDeclaration(grandParent) && ast.GetExternalModuleImportEqualsDeclarationExpression(grandParent) == node) ||
30049-
((parent.Kind == ast.KindImportDeclaration || parent.Kind == ast.KindJSImportDeclaration || parent.Kind == ast.KindExportDeclaration) && parent.AsImportDeclaration().ModuleSpecifier == node) ||
30049+
((parent.Kind == ast.KindImportDeclaration || parent.Kind == ast.KindJSImportDeclaration || parent.Kind == ast.KindExportDeclaration) && ast.GetExternalModuleName(parent) == node) ||
3005030050
ast.IsVariableDeclarationInitializedToRequire(grandParent) ||
3005130051
(ast.IsLiteralTypeNode(parent) && ast.IsLiteralImportTypeNode(grandParent) && grandParent.AsImportTypeNode().Argument == parent) {
3005230052
return c.resolveExternalModuleName(node, node, ignoreErrors)

0 commit comments

Comments
 (0)