(node *ast.Node)
| 1119 | } |
| 1120 | |
| 1121 | func (b *Binder) bindThisPropertyAssignment(node *ast.Node) { |
| 1122 | if !ast.IsInJSFile(node) { |
| 1123 | return |
| 1124 | } |
| 1125 | bin := node.AsBinaryExpression() |
| 1126 | if ast.IsPropertyAccessExpression(bin.Left) && ast.IsPrivateIdentifier(bin.Left.AsPropertyAccessExpression().Name()) || |
| 1127 | b.thisContainer == nil { |
| 1128 | return |
| 1129 | } |
| 1130 | if classSymbol, symbolTable := b.getThisClassAndSymbolTable(); symbolTable != nil { |
| 1131 | if ast.HasDynamicName(node) { |
| 1132 | b.declareSymbolEx(symbolTable, classSymbol, node, ast.SymbolFlagsProperty, ast.SymbolFlagsNone, true /*isReplaceableByMethod*/, true /*isComputedName*/) |
| 1133 | b.addLateBoundAssignmentDeclarationToSymbol(node, classSymbol) |
| 1134 | } else { |
| 1135 | b.declareSymbolEx(symbolTable, classSymbol, node, ast.SymbolFlagsProperty|ast.SymbolFlagsAssignment, ast.SymbolFlagsNone, true /*isReplaceableByMethod*/, false /*isComputedName*/) |
| 1136 | } |
| 1137 | } else if b.thisContainer.Kind != ast.KindFunctionDeclaration && b.thisContainer.Kind != ast.KindFunctionExpression { |
| 1138 | // !!! constructor functions |
| 1139 | panic("Unhandled case in bindThisPropertyAssignment: " + b.thisContainer.Kind.String()) |
| 1140 | } |
| 1141 | } |
| 1142 | |
| 1143 | func (b *Binder) getThisClassAndSymbolTable() (classSymbol *ast.Symbol, symbolTable ast.SymbolTable) { |
| 1144 | if b.thisContainer == nil { |
no test coverage detected