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

647 lines
18 KiB
JSON

{
"type": "Script",
"span": {
"start": 21,
"end": 281,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 21,
"end": 190,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 27,
"end": 190,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 27,
"end": 28,
"ctxt": 0
},
"value": "C",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ClassExpression",
"identifier": {
"type": "Identifier",
"span": {
"start": 37,
"end": 38,
"ctxt": 0
},
"value": "D",
"optional": false
},
"span": {
"start": 31,
"end": 190,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "PrivateProperty",
"span": {
"start": 45,
"end": 73,
"ctxt": 0
},
"key": {
"type": "PrivateName",
"span": {
"start": 52,
"end": 58,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 53,
"end": 58,
"ctxt": 0
},
"value": "field",
"optional": false
}
},
"value": {
"type": "CallExpression",
"span": {
"start": 61,
"end": 72,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 61,
"end": 70,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 61,
"end": 62,
"ctxt": 0
},
"value": "D",
"optional": false
},
"property": {
"type": "PrivateName",
"span": {
"start": 63,
"end": 70,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 64,
"end": 70,
"ctxt": 0
},
"value": "method",
"optional": false
}
}
},
"arguments": [],
"typeArguments": null
},
"typeAnnotation": null,
"isStatic": true,
"decorators": [],
"accessibility": null,
"isOptional": false,
"isOverride": false,
"readonly": false,
"definite": false
},
{
"type": "PrivateMethod",
"span": {
"start": 78,
"end": 109,
"ctxt": 0
},
"key": {
"type": "PrivateName",
"span": {
"start": 85,
"end": 92,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 86,
"end": 92,
"ctxt": 0
},
"value": "method",
"optional": false
}
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 78,
"end": 109,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 95,
"end": 109,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 97,
"end": 107,
"ctxt": 0
},
"argument": {
"type": "NumericLiteral",
"span": {
"start": 104,
"end": 106,
"ctxt": 0
},
"value": 42.0,
"raw": "42"
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": true,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
"start": 114,
"end": 145,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 121,
"end": 129,
"ctxt": 0
},
"value": "getClass",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 114,
"end": 145,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 132,
"end": 145,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 134,
"end": 143,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 141,
"end": 142,
"ctxt": 0
},
"value": "D",
"optional": false
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": true,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
"start": 150,
"end": 187,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 157,
"end": 165,
"ctxt": 0
},
"value": "getField",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 150,
"end": 187,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 168,
"end": 187,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 170,
"end": 185,
"ctxt": 0
},
"argument": {
"type": "MemberExpression",
"span": {
"start": 177,
"end": 185,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 177,
"end": 178,
"ctxt": 0
},
"value": "C",
"optional": false
},
"property": {
"type": "PrivateName",
"span": {
"start": 179,
"end": 185,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 180,
"end": 185,
"ctxt": 0
},
"value": "field",
"optional": false
}
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": true,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "EmptyStatement",
"span": {
"start": 187,
"end": 188,
"ctxt": 0
}
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 192,
"end": 229,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 192,
"end": 228,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 192,
"end": 203,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 192,
"end": 199,
"ctxt": 0
},
"value": "console",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 200,
"end": 203,
"ctxt": 0
},
"value": "log",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "CallExpression",
"span": {
"start": 204,
"end": 227,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 204,
"end": 225,
"ctxt": 0
},
"object": {
"type": "CallExpression",
"span": {
"start": 204,
"end": 216,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 204,
"end": 214,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 204,
"end": 205,
"ctxt": 0
},
"value": "C",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 206,
"end": 214,
"ctxt": 0
},
"value": "getClass",
"optional": false
}
},
"arguments": [],
"typeArguments": null
},
"property": {
"type": "Identifier",
"span": {
"start": 217,
"end": 225,
"ctxt": 0
},
"value": "getField",
"optional": false
}
},
"arguments": [],
"typeArguments": null
}
}
],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 230,
"end": 251,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 230,
"end": 250,
"ctxt": 0
},
"object": {
"type": "CallExpression",
"span": {
"start": 230,
"end": 242,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 230,
"end": 240,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 230,
"end": 231,
"ctxt": 0
},
"value": "C",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 232,
"end": 240,
"ctxt": 0
},
"value": "getClass",
"optional": false
}
},
"arguments": [],
"typeArguments": null
},
"property": {
"type": "PrivateName",
"span": {
"start": 243,
"end": 250,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 244,
"end": 250,
"ctxt": 0
},
"value": "method",
"optional": false
}
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 261,
"end": 281,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 261,
"end": 280,
"ctxt": 0
},
"object": {
"type": "CallExpression",
"span": {
"start": 261,
"end": 273,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 261,
"end": 271,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 261,
"end": 262,
"ctxt": 0
},
"value": "C",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 263,
"end": 271,
"ctxt": 0
},
"value": "getClass",
"optional": false
}
},
"arguments": [],
"typeArguments": null
},
"property": {
"type": "PrivateName",
"span": {
"start": 274,
"end": 280,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 275,
"end": 280,
"ctxt": 0
},
"value": "field",
"optional": false
}
}
}
}
],
"interpreter": null
}