swc/crates/swc_ecma_parser/tests/tsc/privateNameStaticEmitHelpers.json

759 lines
20 KiB
JSON
Raw Normal View History

{
"type": "Module",
"span": {
"start": 93,
"end": 527,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 93,
"end": 203,
"ctxt": 0
},
"declaration": {
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 106,
"end": 107,
"ctxt": 0
},
"value": "S",
"optional": false
},
"declare": false,
"span": {
"start": 100,
"end": 203,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "PrivateProperty",
"span": {
"start": 114,
"end": 128,
"ctxt": 0
},
"key": {
"type": "PrivateName",
"span": {
"start": 121,
"end": 123,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 122,
"end": 123,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 126,
"end": 127,
"ctxt": 0
},
"value": 1.0
},
"typeAnnotation": null,
"isStatic": true,
"decorators": [],
"accessibility": null,
"isOptional": false,
"isOverride": false,
"readonly": false
},
{
"type": "PrivateMethod",
"span": {
"start": 133,
"end": 162,
"ctxt": 0
},
"key": {
"type": "PrivateName",
"span": {
"start": 140,
"end": 142,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 141,
"end": 142,
"ctxt": 0
},
"value": "b",
"optional": false
}
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 133,
"end": 162,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 145,
"end": 162,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 147,
"end": 160,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 147,
"end": 159,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 147,
"end": 154,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 147,
"end": 151,
"ctxt": 0
}
},
"property": {
"type": "PrivateName",
"span": {
"start": 152,
"end": 154,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 153,
"end": 154,
"ctxt": 0
},
"value": "a",
"optional": false
}
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 157,
"end": 159,
"ctxt": 0
},
"value": 42.0
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": true,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "PrivateMethod",
"span": {
"start": 167,
"end": 201,
"ctxt": 0
},
"key": {
"type": "PrivateName",
"span": {
"start": 178,
"end": 180,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 179,
"end": 180,
"ctxt": 0
},
"value": "c",
"optional": false
}
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 167,
"end": 201,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 183,
"end": 201,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 185,
"end": 199,
"ctxt": 0
},
"argument": {
"type": "CallExpression",
"span": {
"start": 192,
"end": 198,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 192,
"end": 196,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 192,
"end": 193,
"ctxt": 0
},
"value": "S",
"optional": false
},
"property": {
"type": "PrivateName",
"span": {
"start": 194,
"end": 196,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 195,
"end": 196,
"ctxt": 0
},
"value": "b",
"optional": false
}
}
},
"arguments": [],
"typeArguments": null
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "getter",
"isStatic": true,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
}
},
{
"type": "ExportDeclaration",
"span": {
"start": 324,
"end": 420,
"ctxt": 0
},
"declaration": {
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 348,
"end": 370,
"ctxt": 0
},
"value": "__classPrivateFieldGet",
"optional": false
},
"declare": true,
"params": [
{
"type": "Parameter",
"span": {
"start": 392,
"end": 403,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 392,
"end": 403,
"ctxt": 0
},
"value": "receiver",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 400,
"end": 403,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 402,
"end": 403,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 402,
"end": 403,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
}
}
},
{
"type": "Parameter",
"span": {
"start": 405,
"end": 415,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 405,
"end": 415,
"ctxt": 0
},
"value": "state",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 410,
"end": 415,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 412,
"end": 415,
"ctxt": 0
},
"kind": "any"
}
}
}
}
],
"decorators": [],
"span": {
"start": 331,
"end": 420,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 370,
"end": 391,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 371,
"end": 387,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 371,
"end": 372,
"ctxt": 0
},
"value": "T",
"optional": false
},
"constraint": {
"type": "TsKeywordType",
"span": {
"start": 381,
"end": 387,
"ctxt": 0
},
"kind": "object"
},
"default": null
},
{
"type": "TsTypeParameter",
"span": {
"start": 389,
"end": 390,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 389,
"end": 390,
"ctxt": 0
},
"value": "V",
"optional": false
},
"constraint": null,
"default": null
}
]
},
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 416,
"end": 419,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 418,
"end": 419,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 418,
"end": 419,
"ctxt": 0
},
"value": "V",
"optional": false
},
"typeParams": null
}
}
}
},
{
"type": "ExportDeclaration",
"span": {
"start": 421,
"end": 527,
"ctxt": 0
},
"declaration": {
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 445,
"end": 467,
"ctxt": 0
},
"value": "__classPrivateFieldSet",
"optional": false
},
"declare": true,
"params": [
{
"type": "Parameter",
"span": {
"start": 489,
"end": 500,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 489,
"end": 500,
"ctxt": 0
},
"value": "receiver",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 497,
"end": 500,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 499,
"end": 500,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 499,
"end": 500,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
}
}
},
{
"type": "Parameter",
"span": {
"start": 502,
"end": 512,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 502,
"end": 512,
"ctxt": 0
},
"value": "state",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 507,
"end": 512,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 509,
"end": 512,
"ctxt": 0
},
"kind": "any"
}
}
}
},
{
"type": "Parameter",
"span": {
"start": 514,
"end": 522,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 514,
"end": 522,
"ctxt": 0
},
"value": "value",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 519,
"end": 522,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 521,
"end": 522,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 521,
"end": 522,
"ctxt": 0
},
"value": "V",
"optional": false
},
"typeParams": null
}
}
}
}
],
"decorators": [],
"span": {
"start": 428,
"end": 527,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 467,
"end": 488,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 468,
"end": 484,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 468,
"end": 469,
"ctxt": 0
},
"value": "T",
"optional": false
},
"constraint": {
"type": "TsKeywordType",
"span": {
"start": 478,
"end": 484,
"ctxt": 0
},
"kind": "object"
},
"default": null
},
{
"type": "TsTypeParameter",
"span": {
"start": 486,
"end": 487,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 486,
"end": 487,
"ctxt": 0
},
"value": "V",
"optional": false
},
"constraint": null,
"default": null
}
]
},
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 523,
"end": 526,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 525,
"end": 526,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 525,
"end": 526,
"ctxt": 0
},
"value": "V",
"optional": false
},
"typeParams": null
}
}
}
}
],
"interpreter": null
}