MCPcopy Index your code
hub / github.com/microsoft/typescript-go / emitPropertyName

Method emitPropertyName

internal/printer/printer.go:1243–1271  ·  view source on GitHub ↗
(node *ast.PropertyName)

Source from the content-addressed store, hash-verified

1241}
1242
1243func (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
1273func (p *Printer) emitMemberName(node *ast.MemberName) {
1274 if node == nil {

Callers 9

emitPropertySignatureMethod · 0.95
emitMethodSignatureMethod · 0.95
emitMethodDeclarationMethod · 0.95
emitBindingElementMethod · 0.95
emitEnumMemberMethod · 0.95

Calls 15

emitIdentifierNameMethod · 0.95
emitPrivateIdentifierMethod · 0.95
emitStringLiteralMethod · 0.95
emitNumericLiteralMethod · 0.95
emitBigIntLiteralMethod · 0.95
panicFunction · 0.85
AsIdentifierMethod · 0.80
AsPrivateIdentifierMethod · 0.80
AsStringLiteralMethod · 0.80

Tested by

no test coverage detected