(name *ast.Node, allowStringLiteral bool)
| 5369 | } |
| 5370 | |
| 5371 | func (c *Checker) checkModuleExportName(name *ast.Node, allowStringLiteral bool) { |
| 5372 | if name == nil || name.Kind != ast.KindStringLiteral { |
| 5373 | return |
| 5374 | } |
| 5375 | if !allowStringLiteral { |
| 5376 | c.grammarErrorOnNode(name, diagnostics.Identifier_expected) |
| 5377 | } else if c.moduleKind == core.ModuleKindES2015 || c.moduleKind == core.ModuleKindES2020 { |
| 5378 | if !ast.GetSourceFileOfNode(name).IsDeclarationFile { |
| 5379 | c.grammarErrorOnNode(name, diagnostics.String_literal_import_and_export_names_are_not_supported_when_the_module_flag_is_set_to_es2015_or_es2020) |
| 5380 | } |
| 5381 | } |
| 5382 | } |
| 5383 | |
| 5384 | func hasTypeJsonImportAttribute(node *ast.Node) bool { |
| 5385 | attributes := node.AsImportDeclaration().Attributes |
no test coverage detected