MCPcopy Create free account
hub / github.com/microsoft/typescript-go / bindNamespaceExportDeclaration

Method bindNamespaceExportDeclaration

internal/binder/binder.go:825–839  ·  view source on GitHub ↗
(node *ast.Node)

Source from the content-addressed store, hash-verified

823}
824
825func (b *Binder) bindNamespaceExportDeclaration(node *ast.Node) {
826 if node.Modifiers() != nil {
827 b.errorOnNode(node, diagnostics.Modifiers_cannot_appear_here)
828 }
829 switch {
830 case !ast.IsSourceFile(node.Parent):
831 b.errorOnNode(node, diagnostics.Global_module_exports_may_only_appear_at_top_level)
832 case !ast.IsExternalModule(node.Parent.AsSourceFile()):
833 b.errorOnNode(node, diagnostics.Global_module_exports_may_only_appear_in_module_files)
834 case !node.Parent.AsSourceFile().IsDeclarationFile:
835 b.errorOnNode(node, diagnostics.Global_module_exports_may_only_appear_in_declaration_files)
836 default:
837 b.declareSymbol(ast.GetSymbolTable(&b.file.GlobalExports), b.file.Symbol, node, ast.SymbolFlagsAlias, ast.SymbolFlagsAliasExcludes)
838 }
839}
840
841func (b *Binder) bindImportClause(node *ast.Node) {
842 if node.AsImportClause().Name() != nil {

Callers 1

bindMethod · 0.95

Calls 7

errorOnNodeMethod · 0.95
declareSymbolMethod · 0.95
IsSourceFileFunction · 0.92
IsExternalModuleFunction · 0.92
GetSymbolTableFunction · 0.92
AsSourceFileMethod · 0.80
ModifiersMethod · 0.65

Tested by

no test coverage detected