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

818 lines
22 KiB
JSON

{
"type": "Module",
"span": {
"start": 94,
"end": 515,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 94,
"end": 191,
"ctxt": 0
},
"declaration": {
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 107,
"end": 108,
"ctxt": 0
},
"value": "C",
"optional": false
},
"declare": false,
"span": {
"start": 101,
"end": 191,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "PrivateProperty",
"span": {
"start": 115,
"end": 122,
"ctxt": 0
},
"key": {
"type": "PrivateName",
"span": {
"start": 115,
"end": 117,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 116,
"end": 117,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 120,
"end": 121,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
},
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": null,
"isOptional": false,
"isOverride": false,
"readonly": false,
"definite": false
},
{
"type": "PrivateMethod",
"span": {
"start": 127,
"end": 149,
"ctxt": 0
},
"key": {
"type": "PrivateName",
"span": {
"start": 127,
"end": 129,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 128,
"end": 129,
"ctxt": 0
},
"value": "b",
"optional": false
}
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 127,
"end": 149,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 132,
"end": 149,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 134,
"end": 147,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 134,
"end": 146,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 134,
"end": 141,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 134,
"end": 138,
"ctxt": 0
}
},
"property": {
"type": "PrivateName",
"span": {
"start": 139,
"end": 141,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 140,
"end": 141,
"ctxt": 0
},
"value": "c",
"optional": false
}
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 144,
"end": 146,
"ctxt": 0
},
"value": 42.0,
"raw": "42"
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "PrivateMethod",
"span": {
"start": 154,
"end": 189,
"ctxt": 0
},
"key": {
"type": "PrivateName",
"span": {
"start": 158,
"end": 160,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 159,
"end": 160,
"ctxt": 0
},
"value": "c",
"optional": false
}
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 161,
"end": 170,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 161,
"end": 170,
"ctxt": 0
},
"value": "v",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 162,
"end": 170,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 164,
"end": 170,
"ctxt": 0
},
"kind": "number"
}
}
}
}
],
"decorators": [],
"span": {
"start": 154,
"end": 189,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 172,
"end": 189,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 174,
"end": 187,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 174,
"end": 186,
"ctxt": 0
},
"operator": "+=",
"left": {
"type": "MemberExpression",
"span": {
"start": 174,
"end": 181,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 174,
"end": 178,
"ctxt": 0
}
},
"property": {
"type": "PrivateName",
"span": {
"start": 179,
"end": 181,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 180,
"end": 181,
"ctxt": 0
},
"value": "a",
"optional": false
}
}
},
"right": {
"type": "Identifier",
"span": {
"start": 185,
"end": 186,
"ctxt": 0
},
"value": "v",
"optional": false
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "setter",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
}
},
{
"type": "ExportDeclaration",
"span": {
"start": 312,
"end": 408,
"ctxt": 0
},
"declaration": {
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 336,
"end": 358,
"ctxt": 0
},
"value": "__classPrivateFieldGet",
"optional": false
},
"declare": true,
"params": [
{
"type": "Parameter",
"span": {
"start": 380,
"end": 391,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 380,
"end": 391,
"ctxt": 0
},
"value": "receiver",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 388,
"end": 391,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 390,
"end": 391,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 390,
"end": 391,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
}
}
},
{
"type": "Parameter",
"span": {
"start": 393,
"end": 403,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 393,
"end": 403,
"ctxt": 0
},
"value": "state",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 398,
"end": 403,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 400,
"end": 403,
"ctxt": 0
},
"kind": "any"
}
}
}
}
],
"decorators": [],
"span": {
"start": 319,
"end": 408,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 358,
"end": 379,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 359,
"end": 375,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 359,
"end": 360,
"ctxt": 0
},
"value": "T",
"optional": false
},
"in": false,
"out": false,
"const": false,
"constraint": {
"type": "TsKeywordType",
"span": {
"start": 369,
"end": 375,
"ctxt": 0
},
"kind": "object"
},
"default": null
},
{
"type": "TsTypeParameter",
"span": {
"start": 377,
"end": 378,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 377,
"end": 378,
"ctxt": 0
},
"value": "V",
"optional": false
},
"in": false,
"out": false,
"const": false,
"constraint": null,
"default": null
}
]
},
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 404,
"end": 407,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 406,
"end": 407,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 406,
"end": 407,
"ctxt": 0
},
"value": "V",
"optional": false
},
"typeParams": null
}
}
}
},
{
"type": "ExportDeclaration",
"span": {
"start": 409,
"end": 515,
"ctxt": 0
},
"declaration": {
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 433,
"end": 455,
"ctxt": 0
},
"value": "__classPrivateFieldSet",
"optional": false
},
"declare": true,
"params": [
{
"type": "Parameter",
"span": {
"start": 477,
"end": 488,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 477,
"end": 488,
"ctxt": 0
},
"value": "receiver",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 485,
"end": 488,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 487,
"end": 488,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 487,
"end": 488,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
}
}
},
{
"type": "Parameter",
"span": {
"start": 490,
"end": 500,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 490,
"end": 500,
"ctxt": 0
},
"value": "state",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 495,
"end": 500,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 497,
"end": 500,
"ctxt": 0
},
"kind": "any"
}
}
}
},
{
"type": "Parameter",
"span": {
"start": 502,
"end": 510,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 502,
"end": 510,
"ctxt": 0
},
"value": "value",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 507,
"end": 510,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 509,
"end": 510,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 509,
"end": 510,
"ctxt": 0
},
"value": "V",
"optional": false
},
"typeParams": null
}
}
}
}
],
"decorators": [],
"span": {
"start": 416,
"end": 515,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 455,
"end": 476,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 456,
"end": 472,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 456,
"end": 457,
"ctxt": 0
},
"value": "T",
"optional": false
},
"in": false,
"out": false,
"const": false,
"constraint": {
"type": "TsKeywordType",
"span": {
"start": 466,
"end": 472,
"ctxt": 0
},
"kind": "object"
},
"default": null
},
{
"type": "TsTypeParameter",
"span": {
"start": 474,
"end": 475,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 474,
"end": 475,
"ctxt": 0
},
"value": "V",
"optional": false
},
"in": false,
"out": false,
"const": false,
"constraint": null,
"default": null
}
]
},
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 511,
"end": 514,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 513,
"end": 514,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 513,
"end": 514,
"ctxt": 0
},
"value": "V",
"optional": false
},
"typeParams": null
}
}
}
}
],
"interpreter": null
}