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

693 lines
21 KiB
JSON

{
"type": "Script",
"span": {
"start": 20,
"end": 407,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 26,
"end": 28,
"ctxt": 0
},
"value": "A3",
"optional": false
},
"declare": false,
"span": {
"start": 20,
"end": 407,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "PrivateMethod",
"span": {
"start": 35,
"end": 55,
"ctxt": 0
},
"key": {
"type": "PrivateName",
"span": {
"start": 42,
"end": 49,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 43,
"end": 49,
"ctxt": 0
},
"value": "method",
"optional": false
}
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 35,
"end": 55,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 52,
"end": 55,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": true,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "EmptyStatement",
"span": {
"start": 55,
"end": 56,
"ctxt": 0
}
},
{
"type": "Constructor",
"span": {
"start": 61,
"end": 405,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 61,
"end": 72,
"ctxt": 0
},
"value": "constructor",
"optional": false
},
"params": [
{
"type": "Parameter",
"span": {
"start": 73,
"end": 85,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 73,
"end": 85,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 74,
"end": 85,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeQuery",
"span": {
"start": 76,
"end": 85,
"ctxt": 0
},
"exprName": {
"type": "Identifier",
"span": {
"start": 83,
"end": 85,
"ctxt": 0
},
"value": "A3",
"optional": false
},
"typeArguments": null
}
}
}
},
{
"type": "Parameter",
"span": {
"start": 87,
"end": 93,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 87,
"end": 93,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 88,
"end": 93,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 90,
"end": 93,
"ctxt": 0
},
"kind": "any"
}
}
}
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 95,
"end": 405,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 105,
"end": 126,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 105,
"end": 126,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 105,
"end": 115,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 105,
"end": 107,
"ctxt": 0
},
"value": "A3",
"optional": false
},
"property": {
"type": "PrivateName",
"span": {
"start": 108,
"end": 115,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 109,
"end": 115,
"ctxt": 0
},
"value": "method",
"optional": false
}
}
},
"right": {
"type": "ArrowFunctionExpression",
"span": {
"start": 118,
"end": 126,
"ctxt": 0
},
"params": [],
"body": {
"type": "BlockStatement",
"span": {
"start": 124,
"end": 126,
"ctxt": 0
},
"stmts": []
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 159,
"end": 181,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 159,
"end": 180,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 159,
"end": 168,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 159,
"end": 160,
"ctxt": 0
},
"value": "a",
"optional": false
},
"property": {
"type": "PrivateName",
"span": {
"start": 161,
"end": 168,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 162,
"end": 168,
"ctxt": 0
},
"value": "method",
"optional": false
}
}
},
"right": {
"type": "ArrowFunctionExpression",
"span": {
"start": 171,
"end": 180,
"ctxt": 0
},
"params": [],
"body": {
"type": "BlockStatement",
"span": {
"start": 177,
"end": 180,
"ctxt": 0
},
"stmts": []
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 214,
"end": 236,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 214,
"end": 236,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 214,
"end": 223,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 214,
"end": 215,
"ctxt": 0
},
"value": "b",
"optional": false
},
"property": {
"type": "PrivateName",
"span": {
"start": 216,
"end": 223,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 217,
"end": 223,
"ctxt": 0
},
"value": "method",
"optional": false
}
}
},
"right": {
"type": "ArrowFunctionExpression",
"span": {
"start": 227,
"end": 236,
"ctxt": 0
},
"params": [],
"body": {
"type": "BlockStatement",
"span": {
"start": 233,
"end": 236,
"ctxt": 0
},
"stmts": []
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 268,
"end": 305,
"ctxt": 0
},
"expression": {
"type": "ParenthesisExpression",
"span": {
"start": 268,
"end": 304,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 269,
"end": 303,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "ObjectPattern",
"span": {
"start": 269,
"end": 286,
"ctxt": 0
},
"properties": [
{
"type": "KeyValuePatternProperty",
"key": {
"type": "Identifier",
"span": {
"start": 271,
"end": 272,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": {
"type": "MemberExpression",
"span": {
"start": 274,
"end": 284,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 274,
"end": 276,
"ctxt": 0
},
"value": "A3",
"optional": false
},
"property": {
"type": "PrivateName",
"span": {
"start": 277,
"end": 284,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 278,
"end": 284,
"ctxt": 0
},
"value": "method",
"optional": false
}
}
}
}
],
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "ObjectExpression",
"span": {
"start": 289,
"end": 303,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 291,
"end": 292,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": {
"type": "ArrowFunctionExpression",
"span": {
"start": 294,
"end": 302,
"ctxt": 0
},
"params": [],
"body": {
"type": "BlockStatement",
"span": {
"start": 300,
"end": 302,
"ctxt": 0
},
"stmts": []
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
}
}
]
}
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 337,
"end": 356,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 341,
"end": 355,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 341,
"end": 342,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 345,
"end": 355,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 345,
"end": 347,
"ctxt": 0
},
"value": "A3",
"optional": false
},
"property": {
"type": "PrivateName",
"span": {
"start": 348,
"end": 355,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 349,
"end": 355,
"ctxt": 0
},
"value": "method",
"optional": false
}
}
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 365,
"end": 376,
"ctxt": 0
},
"expression": {
"type": "UpdateExpression",
"span": {
"start": 365,
"end": 376,
"ctxt": 0
},
"operator": "++",
"prefix": false,
"argument": {
"type": "MemberExpression",
"span": {
"start": 365,
"end": 374,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 365,
"end": 366,
"ctxt": 0
},
"value": "b",
"optional": false
},
"property": {
"type": "PrivateName",
"span": {
"start": 367,
"end": 374,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 368,
"end": 374,
"ctxt": 0
},
"value": "method",
"optional": false
}
}
}
}
}
]
},
"accessibility": null,
"isOptional": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
}
],
"interpreter": null
}