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

1392 lines
47 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 20,
"end": 572,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 26,
"end": 27,
"ctxt": 0
},
"value": "A",
"optional": false
},
"declare": false,
"span": {
"start": 20,
"end": 572,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "PrivateMethod",
"span": {
"start": 34,
"end": 90,
"ctxt": 0
},
"key": {
"type": "PrivateName",
"span": {
"start": 38,
"end": 48,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 39,
"end": 48,
"ctxt": 0
},
"value": "fieldFunc",
"optional": false
}
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 34,
"end": 90,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 51,
"end": 90,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 54,
"end": 88,
"ctxt": 0
},
"argument": {
"type": "FunctionExpression",
"identifier": null,
"params": [],
"decorators": [],
"span": {
"start": 61,
"end": 88,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 72,
"end": 88,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 74,
"end": 86,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 74,
"end": 85,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 74,
"end": 80,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 74,
"end": 78,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 79,
"end": 80,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 83,
"end": 85,
"ctxt": 0
},
"value": 10.0
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "getter",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "PrivateMethod",
"span": {
"start": 95,
"end": 146,
"ctxt": 0
},
"key": {
"type": "PrivateName",
"span": {
"start": 99,
"end": 110,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 100,
"end": 110,
"ctxt": 0
},
"value": "fieldFunc2",
"optional": false
}
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 95,
"end": 146,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 113,
"end": 146,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 115,
"end": 144,
"ctxt": 0
},
"argument": {
"type": "FunctionExpression",
"identifier": null,
"params": [
{
"type": "Parameter",
"span": {
"start": 132,
"end": 133,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 132,
"end": 133,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": null
}
},
{
"type": "Parameter",
"span": {
"start": 135,
"end": 139,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "RestElement",
"span": {
"start": 135,
"end": 139,
"ctxt": 0
},
"rest": {
"start": 135,
"end": 138,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 138,
"end": 139,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": null
},
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 123,
"end": 143,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 141,
"end": 143,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "getter",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassProperty",
"span": {
"start": 151,
"end": 157,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 151,
"end": 152,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 155,
"end": 156,
"ctxt": 0
},
"value": 1.0
},
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
},
{
"type": "ClassMethod",
"span": {
"start": 162,
"end": 532,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 162,
"end": 166,
"ctxt": 0
},
"value": "test",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 162,
"end": 532,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 169,
"end": 532,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 179,
"end": 197,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 179,
"end": 196,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 179,
"end": 194,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 179,
"end": 183,
"ctxt": 0
}
},
"property": {
"type": "PrivateName",
"span": {
"start": 184,
"end": 194,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 185,
"end": 194,
"ctxt": 0
},
"value": "fieldFunc",
"optional": false
}
}
},
"arguments": [],
"typeArguments": null
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 206,
"end": 235,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 212,
"end": 234,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 212,
"end": 216,
"ctxt": 0
},
"value": "func",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 219,
"end": 234,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 219,
"end": 223,
"ctxt": 0
}
},
"property": {
"type": "PrivateName",
"span": {
"start": 224,
"end": 234,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 225,
"end": 234,
"ctxt": 0
},
"value": "fieldFunc",
"optional": false
}
}
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 244,
"end": 251,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 244,
"end": 250,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 244,
"end": 248,
"ctxt": 0
},
"value": "func",
"optional": false
},
"arguments": [],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 260,
"end": 282,
"ctxt": 0
},
"expression": {
"type": "NewExpression",
"span": {
"start": 260,
"end": 281,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 264,
"end": 279,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 264,
"end": 268,
"ctxt": 0
}
},
"property": {
"type": "PrivateName",
"span": {
"start": 269,
"end": 279,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 270,
"end": 279,
"ctxt": 0
},
"value": "fieldFunc",
"optional": false
}
}
},
"arguments": [],
"typeArguments": null
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 292,
"end": 313,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 298,
"end": 312,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 298,
"end": 301,
"ctxt": 0
},
"value": "arr",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ArrayExpression",
"span": {
"start": 304,
"end": 312,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 306,
"end": 307,
"ctxt": 0
},
"value": 1.0
}
},
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 309,
"end": 310,
"ctxt": 0
},
"value": 2.0
}
}
]
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 322,
"end": 353,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 322,
"end": 352,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 322,
"end": 338,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 322,
"end": 326,
"ctxt": 0
}
},
"property": {
"type": "PrivateName",
"span": {
"start": 327,
"end": 338,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 328,
"end": 338,
"ctxt": 0
},
"value": "fieldFunc2",
"optional": false
}
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 339,
"end": 340,
"ctxt": 0
},
"value": 0.0
}
},
{
"spread": {
"start": 342,
"end": 345,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 345,
"end": 348,
"ctxt": 0
},
"value": "arr",
"optional": false
}
},
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 350,
"end": 351,
"ctxt": 0
},
"value": 3.0
}
}
],
"typeArguments": null
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 362,
"end": 407,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 368,
"end": 406,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 368,
"end": 369,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NewExpression",
"span": {
"start": 372,
"end": 406,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 376,
"end": 392,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 376,
"end": 380,
"ctxt": 0
}
},
"property": {
"type": "PrivateName",
"span": {
"start": 381,
"end": 392,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 382,
"end": 392,
"ctxt": 0
},
"value": "fieldFunc2",
"optional": false
}
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 393,
"end": 394,
"ctxt": 0
},
"value": 0.0
}
},
{
"spread": {
"start": 396,
"end": 399,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 399,
"end": 402,
"ctxt": 0
},
"value": "arr",
"optional": false
}
},
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 404,
"end": 405,
"ctxt": 0
},
"value": 3.0
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 416,
"end": 469,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 422,
"end": 468,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 422,
"end": 425,
"ctxt": 0
},
"value": "str",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "TaggedTemplateExpression",
"span": {
"start": 428,
"end": 468,
"ctxt": 0
},
"tag": {
"type": "MemberExpression",
"span": {
"start": 428,
"end": 444,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 428,
"end": 432,
"ctxt": 0
}
},
"property": {
"type": "PrivateName",
"span": {
"start": 433,
"end": 444,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 434,
"end": 444,
"ctxt": 0
},
"value": "fieldFunc2",
"optional": false
}
}
},
"typeParameters": null,
"template": {
"type": "TemplateLiteral",
"span": {
"start": 444,
"end": 468,
"ctxt": 0
},
"expressions": [
{
"type": "NumericLiteral",
"span": {
"start": 451,
"end": 452,
"ctxt": 0
},
"value": 1.0
},
{
"type": "NumericLiteral",
"span": {
"start": 461,
"end": 462,
"ctxt": 0
},
"value": 2.0
}
],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 445,
"end": 449,
"ctxt": 0
},
"tail": false,
"cooked": {
"type": "StringLiteral",
"span": {
"start": 445,
"end": 449,
"ctxt": 0
},
"value": "head",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": false
}
},
"raw": {
"type": "StringLiteral",
"span": {
"start": 445,
"end": 449,
"ctxt": 0
},
"value": "head",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": false
}
}
},
{
"type": "TemplateElement",
"span": {
"start": 453,
"end": 459,
"ctxt": 0
},
"tail": false,
"cooked": {
"type": "StringLiteral",
"span": {
"start": 453,
"end": 459,
"ctxt": 0
},
"value": "middle",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": false
}
},
"raw": {
"type": "StringLiteral",
"span": {
"start": 453,
"end": 459,
"ctxt": 0
},
"value": "middle",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": false
}
}
},
{
"type": "TemplateElement",
"span": {
"start": 463,
"end": 467,
"ctxt": 0
},
"tail": true,
"cooked": {
"type": "StringLiteral",
"span": {
"start": 463,
"end": 467,
"ctxt": 0
},
"value": "tail",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": false
}
},
"raw": {
"type": "StringLiteral",
"span": {
"start": 463,
"end": 467,
"ctxt": 0
},
"value": "tail",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": false
}
}
}
]
}
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 478,
"end": 526,
"ctxt": 0
},
"expression": {
"type": "TaggedTemplateExpression",
"span": {
"start": 478,
"end": 525,
"ctxt": 0
},
"tag": {
"type": "MemberExpression",
"span": {
"start": 478,
"end": 508,
"ctxt": 0
},
"object": {
"type": "CallExpression",
"span": {
"start": 478,
"end": 496,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 478,
"end": 494,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 478,
"end": 482,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 483,
"end": 494,
"ctxt": 0
},
"value": "getInstance",
"optional": false
}
},
"arguments": [],
"typeArguments": null
},
"property": {
"type": "PrivateName",
"span": {
"start": 497,
"end": 508,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 498,
"end": 508,
"ctxt": 0
},
"value": "fieldFunc2",
"optional": false
}
}
},
"typeParameters": null,
"template": {
"type": "TemplateLiteral",
"span": {
"start": 508,
"end": 525,
"ctxt": 0
},
"expressions": [
{
"type": "NumericLiteral",
"span": {
"start": 515,
"end": 516,
"ctxt": 0
},
"value": 1.0
},
{
"type": "NumericLiteral",
"span": {
"start": 522,
"end": 523,
"ctxt": 0
},
"value": 2.0
}
],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 509,
"end": 513,
"ctxt": 0
},
"tail": false,
"cooked": {
"type": "StringLiteral",
"span": {
"start": 509,
"end": 513,
"ctxt": 0
},
"value": "test",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": false
}
},
"raw": {
"type": "StringLiteral",
"span": {
"start": 509,
"end": 513,
"ctxt": 0
},
"value": "test",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": false
}
}
},
{
"type": "TemplateElement",
"span": {
"start": 517,
"end": 520,
"ctxt": 0
},
"tail": false,
"cooked": {
"type": "StringLiteral",
"span": {
"start": 517,
"end": 520,
"ctxt": 0
},
"value": "and",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": false
}
},
"raw": {
"type": "StringLiteral",
"span": {
"start": 517,
"end": 520,
"ctxt": 0
},
"value": "and",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": false
}
}
},
{
"type": "TemplateElement",
"span": {
"start": 524,
"end": 524,
"ctxt": 0
},
"tail": true,
"cooked": {
"type": "StringLiteral",
"span": {
"start": 524,
"end": 524,
"ctxt": 0
},
"value": "",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": false
}
},
"raw": {
"type": "StringLiteral",
"span": {
"start": 524,
"end": 524,
"ctxt": 0
},
"value": "",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": false
}
}
}
]
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
"start": 537,
"end": 570,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 537,
"end": 548,
"ctxt": 0
},
"value": "getInstance",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 537,
"end": 570,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 551,
"end": 570,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 553,
"end": 568,
"ctxt": 0
},
"argument": {
"type": "NewExpression",
"span": {
"start": 560,
"end": 567,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 564,
"end": 565,
"ctxt": 0
},
"value": "A",
"optional": false
},
"arguments": [],
"typeArguments": null
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
}
],
"interpreter": null
}