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

Method bindExportAssignment

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

Source from the content-addressed store, hash-verified

858}
859
860func (b *Binder) bindExportAssignment(node *ast.Node) {
861 container := b.container
862 if container.Symbol() == nil && ast.IsExportAssignment(node) {
863 // Incorrect export assignment in some sort of block construct
864 b.bindAnonymousDeclaration(node, ast.SymbolFlagsValue, b.getDeclarationName(node))
865 } else {
866 // If there is an `export default x;` alias declaration, can't `export default` anything else.
867 // (In contrast, you can still have `export default function f() {}` and `export default interface I {}`.)
868 flags := core.IfElse(ast.ExpressionIsAlias(node.Expression()), ast.SymbolFlagsAlias, ast.SymbolFlagsProperty)
869 symbol := b.declareSymbol(ast.GetExports(container.Symbol()), container.Symbol(), node, flags, ast.SymbolFlagsAll)
870 if node.AsExportAssignment().IsExportEquals {
871 // Ensure export assignments have a ValueDeclaration set.
872 SetValueDeclaration(symbol, node)
873 }
874 }
875}
876
877func (b *Binder) bindJsxAttributes(node *ast.Node) {
878 b.bindAnonymousDeclaration(node, ast.SymbolFlagsObjectLiteral, ast.InternalSymbolNameJSXAttributes)

Callers 1

bindMethod · 0.95

Calls 11

getDeclarationNameMethod · 0.95
declareSymbolMethod · 0.95
IsExportAssignmentFunction · 0.92
IfElseFunction · 0.92
ExpressionIsAliasFunction · 0.92
GetExportsFunction · 0.92
SetValueDeclarationFunction · 0.85
ExpressionMethod · 0.80
AsExportAssignmentMethod · 0.80
SymbolMethod · 0.65

Tested by

no test coverage detected