(node *ast.Node)
| 1054 | } |
| 1055 | |
| 1056 | func (b *Binder) bindDeferredExpandoAssignment(node *ast.Node) { |
| 1057 | parent := getParentOfPropertyAssignment(node) |
| 1058 | symbol := b.lookupEntity(parent, b.blockScopeContainer) |
| 1059 | if symbol == nil { |
| 1060 | symbol = b.lookupEntity(parent, b.container) |
| 1061 | } |
| 1062 | if symbol = getInitializerSymbol(symbol); symbol != nil { |
| 1063 | if ast.HasDynamicName(node) { |
| 1064 | b.bindAnonymousDeclaration(node, ast.SymbolFlagsProperty|ast.SymbolFlagsAssignment, ast.InternalSymbolNameComputed) |
| 1065 | b.addLateBoundAssignmentDeclarationToSymbol(node, symbol) |
| 1066 | } else { |
| 1067 | // We declare expandos only when there are no non-expando declarations for that name. |
| 1068 | exports := ast.GetExports(symbol) |
| 1069 | if existing := exports[b.getDeclarationName(node)]; existing == nil || existing.Flags&ast.SymbolFlagsAssignment != 0 { |
| 1070 | b.declareSymbol(exports, symbol, node, ast.SymbolFlagsProperty|ast.SymbolFlagsAssignment, ast.SymbolFlagsPropertyExcludes) |
| 1071 | } |
| 1072 | } |
| 1073 | } |
| 1074 | } |
| 1075 | |
| 1076 | func getParentOfPropertyAssignment(node *ast.Node) *ast.Node { |
| 1077 | switch node.Kind { |
no test coverage detected