Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions internal/compiler/fileloader.go
Original file line number Diff line number Diff line change
Expand Up @@ -790,12 +790,16 @@ func getModuleLiteralImportKind(node *ast.StringLiteralLike) *string {
}

if ast.IsImportDeclaration(parent) || ast.IsExportDeclaration(parent) {
var elements []*ast.Node
var attrs *ast.ImportAttributesNode
if ast.IsImportDeclaration(parent) {
elements = parent.AsImportDeclaration().Attributes.AsImportAttributes().Attributes.Nodes
attrs = parent.AsImportDeclaration().Attributes
} else {
elements = parent.AsExportDeclaration().Attributes.AsImportAttributes().Attributes.Nodes
attrs = parent.AsExportDeclaration().Attributes
}
if attrs == nil {
return nil
}
elements := attrs.AsImportAttributes().Attributes.Nodes
if elements == nil {
return nil
}
Expand Down