swc/crates/swc_ecma_parser/tests/tsc/privateNameStaticFieldClassExpression.json
2022-02-04 17:08:38 +09:00

717 lines
22 KiB
JSON

{
"type": "Script",
"span": {
"start": 20,
"end": 381,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 26,
"end": 27,
"ctxt": 0
},
"value": "B",
"optional": false
},
"declare": false,
"span": {
"start": 20,
"end": 381,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "PrivateProperty",
"span": {
"start": 34,
"end": 204,
"ctxt": 0
},
"key": {
"type": "PrivateName",
"span": {
"start": 41,
"end": 45,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 42,
"end": 45,
"ctxt": 0
},
"value": "foo",
"optional": false
}
},
"value": {
"type": "ClassExpression",
"identifier": null,
"span": {
"start": 48,
"end": 203,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "Constructor",
"span": {
"start": 64,
"end": 150,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 64,
"end": 75,
"ctxt": 0
},
"value": "constructor",
"optional": false
},
"params": [],
"body": {
"type": "BlockStatement",
"span": {
"start": 78,
"end": 150,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 92,
"end": 113,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 92,
"end": 112,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 92,
"end": 103,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 92,
"end": 99,
"ctxt": 0
},
"value": "console",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 100,
"end": 103,
"ctxt": 0
},
"value": "log",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 104,
"end": 111,
"ctxt": 0
},
"value": "hello",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 126,
"end": 140,
"ctxt": 0
},
"expression": {
"type": "NewExpression",
"span": {
"start": 126,
"end": 139,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 130,
"end": 137,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 130,
"end": 131,
"ctxt": 0
},
"value": "B",
"optional": false
},
"property": {
"type": "PrivateName",
"span": {
"start": 132,
"end": 137,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 133,
"end": 137,
"ctxt": 0
},
"value": "foo2",
"optional": false
}
}
},
"arguments": [],
"typeArguments": null
}
}
]
},
"accessibility": null,
"isOptional": false
},
{
"type": "ClassProperty",
"span": {
"start": 159,
"end": 177,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 166,
"end": 170,
"ctxt": 0
},
"value": "test",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 173,
"end": 176,
"ctxt": 0
},
"value": 123.0
},
"typeAnnotation": null,
"isStatic": true,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
},
{
"type": "ClassProperty",
"span": {
"start": 186,
"end": 197,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 186,
"end": 191,
"ctxt": 0
},
"value": "field",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 194,
"end": 196,
"ctxt": 0
},
"value": 10.0
},
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
"typeAnnotation": null,
"isStatic": true,
"decorators": [],
"computed": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"definite": false
},
{
"type": "PrivateProperty",
"span": {
"start": 209,
"end": 275,
"ctxt": 0
},
"key": {
"type": "PrivateName",
"span": {
"start": 216,
"end": 221,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 217,
"end": 221,
"ctxt": 0
},
"value": "foo2",
"optional": false
}
},
"value": {
"type": "ClassExpression",
"identifier": {
"type": "Identifier",
"span": {
"start": 230,
"end": 233,
"ctxt": 0
},
"value": "Foo",
"optional": false
},
"span": {
"start": 224,
"end": 274,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 244,
"end": 268,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 251,
"end": 261,
"ctxt": 0
},
"value": "otherClass",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 264,
"end": 267,
"ctxt": 0
},
"value": 123.0
},
"typeAnnotation": null,
"isStatic": true,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
"typeAnnotation": null,
"isStatic": true,
"decorators": [],
"computed": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"definite": false
},
{
"type": "ClassMethod",
"span": {
"start": 281,
"end": 379,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 281,
"end": 282,
"ctxt": 0
},
"value": "m",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 281,
"end": 379,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 285,
"end": 379,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 295,
"end": 319,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 295,
"end": 319,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 295,
"end": 306,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 295,
"end": 302,
"ctxt": 0
},
"value": "console",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 303,
"end": 306,
"ctxt": 0
},
"value": "log",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "MemberExpression",
"span": {
"start": 307,
"end": 318,
"ctxt": 0
},
"object": {
"type": "MemberExpression",
"span": {
"start": 307,
"end": 313,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 307,
"end": 308,
"ctxt": 0
},
"value": "B",
"optional": false
},
"property": {
"type": "PrivateName",
"span": {
"start": 309,
"end": 313,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 310,
"end": 313,
"ctxt": 0
},
"value": "foo",
"optional": false
}
}
},
"property": {
"type": "Identifier",
"span": {
"start": 314,
"end": 318,
"ctxt": 0
},
"value": "test",
"optional": false
}
}
}
],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 328,
"end": 345,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 328,
"end": 344,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 328,
"end": 339,
"ctxt": 0
},
"object": {
"type": "MemberExpression",
"span": {
"start": 328,
"end": 334,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 328,
"end": 329,
"ctxt": 0
},
"value": "B",
"optional": false
},
"property": {
"type": "PrivateName",
"span": {
"start": 330,
"end": 334,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 331,
"end": 334,
"ctxt": 0
},
"value": "foo",
"optional": false
}
}
},
"property": {
"type": "Identifier",
"span": {
"start": 335,
"end": 339,
"ctxt": 0
},
"value": "test",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 342,
"end": 344,
"ctxt": 0
},
"value": 10.0
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 354,
"end": 373,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 354,
"end": 372,
"ctxt": 0
},
"object": {
"type": "NewExpression",
"span": {
"start": 354,
"end": 366,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 358,
"end": 364,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 358,
"end": 359,
"ctxt": 0
},
"value": "B",
"optional": false
},
"property": {
"type": "PrivateName",
"span": {
"start": 360,
"end": 364,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 361,
"end": 364,
"ctxt": 0
},
"value": "foo",
"optional": false
}
}
},
"arguments": [],
"typeArguments": null
},
"property": {
"type": "Identifier",
"span": {
"start": 367,
"end": 372,
"ctxt": 0
},
"value": "field",
"optional": false
}
}
}
]
},
"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
}