We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents d82156d + 6110618 commit 06a2c64Copy full SHA for 06a2c64
1 file changed
internal/compiler/fileloader.go
@@ -790,12 +790,16 @@ func getModuleLiteralImportKind(node *ast.StringLiteralLike) *string {
790
}
791
792
if ast.IsImportDeclaration(parent) || ast.IsExportDeclaration(parent) {
793
- var elements []*ast.Node
+ var attrs *ast.ImportAttributesNode
794
if ast.IsImportDeclaration(parent) {
795
- elements = parent.AsImportDeclaration().Attributes.AsImportAttributes().Attributes.Nodes
+ attrs = parent.AsImportDeclaration().Attributes
796
} else {
797
- elements = parent.AsExportDeclaration().Attributes.AsImportAttributes().Attributes.Nodes
+ attrs = parent.AsExportDeclaration().Attributes
798
799
+ if attrs == nil {
800
+ return nil
801
+ }
802
+ elements := attrs.AsImportAttributes().Attributes.Nodes
803
if elements == nil {
804
return nil
805
0 commit comments