(node *ast.PropertyName)
| 1241 | } |
| 1242 | |
| 1243 | func (p *Printer) emitPropertyName(node *ast.PropertyName) { |
| 1244 | if node == nil { |
| 1245 | return |
| 1246 | } |
| 1247 | |
| 1248 | savedWriteKind := p.writeKind |
| 1249 | p.writeKind = WriteKindProperty |
| 1250 | |
| 1251 | switch node.Kind { |
| 1252 | case ast.KindIdentifier: |
| 1253 | p.emitIdentifierName(node.AsIdentifier()) |
| 1254 | case ast.KindPrivateIdentifier: |
| 1255 | p.emitPrivateIdentifier(node.AsPrivateIdentifier()) |
| 1256 | case ast.KindStringLiteral: |
| 1257 | p.emitStringLiteral(node.AsStringLiteral()) |
| 1258 | case ast.KindNoSubstitutionTemplateLiteral: |
| 1259 | p.emitNoSubstitutionTemplateLiteral(node.AsNoSubstitutionTemplateLiteral()) |
| 1260 | case ast.KindNumericLiteral: |
| 1261 | p.emitNumericLiteral(node.AsNumericLiteral()) |
| 1262 | case ast.KindBigIntLiteral: |
| 1263 | p.emitBigIntLiteral(node.AsBigIntLiteral()) |
| 1264 | case ast.KindComputedPropertyName: |
| 1265 | p.emitComputedPropertyName(node.AsComputedPropertyName()) |
| 1266 | default: |
| 1267 | panic(fmt.Sprintf("unexpected PropertyName: %v", node.Kind)) |
| 1268 | } |
| 1269 | |
| 1270 | p.writeKind = savedWriteKind |
| 1271 | } |
| 1272 | |
| 1273 | func (p *Printer) emitMemberName(node *ast.MemberName) { |
| 1274 | if node == nil { |
no test coverage detected