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

693 lines
21 KiB
JSON

{
"type": "Script",
"span": {
"start": 21,
"end": 408,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 27,
"end": 29,
"ctxt": 0
},
"value": "A3",
"optional": false
},
"declare": false,
"span": {
"start": 21,
"end": 408,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "PrivateMethod",
"span": {
"start": 36,
"end": 56,
"ctxt": 0
},
"key": {
"type": "PrivateName",
"span": {
"start": 43,
"end": 50,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 44,
"end": 50,
"ctxt": 0
},
"value": "method",
"optional": false
}
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 36,
"end": 56,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 53,
"end": 56,
"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": 56,
"end": 57,
"ctxt": 0
}
},
{
"type": "Constructor",
"span": {
"start": 62,
"end": 406,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 62,
"end": 73,
"ctxt": 0
},
"value": "constructor",
"optional": false
},
"params": [
{
"type": "Parameter",
"span": {
"start": 74,
"end": 86,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 74,
"end": 86,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 75,
"end": 86,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeQuery",
"span": {
"start": 77,
"end": 86,
"ctxt": 0
},
"exprName": {
"type": "Identifier",
"span": {
"start": 84,
"end": 86,
"ctxt": 0
},
"value": "A3",
"optional": false
},
"typeArguments": null
}
}
}
},
{
"type": "Parameter",
"span": {
"start": 88,
"end": 94,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 88,
"end": 94,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 89,
"end": 94,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 91,
"end": 94,
"ctxt": 0
},
"kind": "any"
}
}
}
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 96,
"end": 406,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 106,
"end": 127,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 106,
"end": 127,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 106,
"end": 116,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 106,
"end": 108,
"ctxt": 0
},
"value": "A3",
"optional": false
},
"property": {
"type": "PrivateName",
"span": {
"start": 109,
"end": 116,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 110,
"end": 116,
"ctxt": 0
},
"value": "method",
"optional": false
}
}
},
"right": {
"type": "ArrowFunctionExpression",
"span": {
"start": 119,
"end": 127,
"ctxt": 0
},
"params": [],
"body": {
"type": "BlockStatement",
"span": {
"start": 125,
"end": 127,
"ctxt": 0
},
"stmts": []
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 160,
"end": 182,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 160,
"end": 181,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 160,
"end": 169,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 160,
"end": 161,
"ctxt": 0
},
"value": "a",
"optional": false
},
"property": {
"type": "PrivateName",
"span": {
"start": 162,
"end": 169,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 163,
"end": 169,
"ctxt": 0
},
"value": "method",
"optional": false
}
}
},
"right": {
"type": "ArrowFunctionExpression",
"span": {
"start": 172,
"end": 181,
"ctxt": 0
},
"params": [],
"body": {
"type": "BlockStatement",
"span": {
"start": 178,
"end": 181,
"ctxt": 0
},
"stmts": []
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 215,
"end": 237,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 215,
"end": 237,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 215,
"end": 224,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 215,
"end": 216,
"ctxt": 0
},
"value": "b",
"optional": false
},
"property": {
"type": "PrivateName",
"span": {
"start": 217,
"end": 224,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 218,
"end": 224,
"ctxt": 0
},
"value": "method",
"optional": false
}
}
},
"right": {
"type": "ArrowFunctionExpression",
"span": {
"start": 228,
"end": 237,
"ctxt": 0
},
"params": [],
"body": {
"type": "BlockStatement",
"span": {
"start": 234,
"end": 237,
"ctxt": 0
},
"stmts": []
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 269,
"end": 306,
"ctxt": 0
},
"expression": {
"type": "ParenthesisExpression",
"span": {
"start": 269,
"end": 305,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 270,
"end": 304,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "ObjectPattern",
"span": {
"start": 270,
"end": 287,
"ctxt": 0
},
"properties": [
{
"type": "KeyValuePatternProperty",
"key": {
"type": "Identifier",
"span": {
"start": 272,
"end": 273,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": {
"type": "MemberExpression",
"span": {
"start": 275,
"end": 285,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 275,
"end": 277,
"ctxt": 0
},
"value": "A3",
"optional": false
},
"property": {
"type": "PrivateName",
"span": {
"start": 278,
"end": 285,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 279,
"end": 285,
"ctxt": 0
},
"value": "method",
"optional": false
}
}
}
}
],
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "ObjectExpression",
"span": {
"start": 290,
"end": 304,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 292,
"end": 293,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": {
"type": "ArrowFunctionExpression",
"span": {
"start": 295,
"end": 303,
"ctxt": 0
},
"params": [],
"body": {
"type": "BlockStatement",
"span": {
"start": 301,
"end": 303,
"ctxt": 0
},
"stmts": []
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
}
}
]
}
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 338,
"end": 357,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 342,
"end": 356,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 342,
"end": 343,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 346,
"end": 356,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 346,
"end": 348,
"ctxt": 0
},
"value": "A3",
"optional": false
},
"property": {
"type": "PrivateName",
"span": {
"start": 349,
"end": 356,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 350,
"end": 356,
"ctxt": 0
},
"value": "method",
"optional": false
}
}
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 366,
"end": 377,
"ctxt": 0
},
"expression": {
"type": "UpdateExpression",
"span": {
"start": 366,
"end": 377,
"ctxt": 0
},
"operator": "++",
"prefix": false,
"argument": {
"type": "MemberExpression",
"span": {
"start": 366,
"end": 375,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 366,
"end": 367,
"ctxt": 0
},
"value": "b",
"optional": false
},
"property": {
"type": "PrivateName",
"span": {
"start": 368,
"end": 375,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 369,
"end": 375,
"ctxt": 0
},
"value": "method",
"optional": false
}
}
}
}
}
]
},
"accessibility": null,
"isOptional": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
}
],
"interpreter": null
}