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

1145 lines
28 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 0,
"end": 462,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 6,
"end": 7,
"ctxt": 0
},
"value": "C",
"optional": false
},
"declare": false,
"span": {
"start": 0,
"end": 223,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 15,
"end": 24,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 22,
"end": 23,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": null,
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": "public",
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
},
{
"type": "ClassProperty",
"span": {
"start": 30,
"end": 44,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 37,
"end": 38,
"ctxt": 0
},
"value": "a",
"optional": false
},
"value": {
"type": "StringLiteral",
"span": {
"start": 41,
"end": 43,
"ctxt": 0
},
"value": "",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
},
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": "public",
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
},
{
"type": "ClassProperty",
"span": {
"start": 50,
"end": 72,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 57,
"end": 58,
"ctxt": 0
},
"value": "b",
"optional": false
},
"value": {
"type": "StringLiteral",
"span": {
"start": 69,
"end": 71,
"ctxt": 0
},
"value": "",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
},
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 58,
"end": 66,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 60,
"end": 66,
"ctxt": 0
},
"kind": "string"
}
},
"isStatic": false,
"decorators": [],
"accessibility": "public",
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
},
{
"type": "ClassMethod",
"span": {
"start": 78,
"end": 102,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 85,
"end": 86,
"ctxt": 0
},
"value": "c",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 78,
"end": 102,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 89,
"end": 102,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 91,
"end": 100,
"ctxt": 0
},
"argument": {
"type": "StringLiteral",
"span": {
"start": 98,
"end": 100,
"ctxt": 0
},
"value": "",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": false,
"accessibility": "public",
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassProperty",
"span": {
"start": 108,
"end": 128,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 115,
"end": 116,
"ctxt": 0
},
"value": "d",
"optional": false
},
"value": {
"type": "ArrowFunctionExpression",
"span": {
"start": 119,
"end": 127,
"ctxt": 0
},
"params": [],
"body": {
"type": "StringLiteral",
"span": {
"start": 125,
"end": 127,
"ctxt": 0
},
"value": "",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
},
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": "public",
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
},
{
"type": "ClassProperty",
"span": {
"start": 134,
"end": 150,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 148,
"end": 149,
"ctxt": 0
},
"value": "e",
"optional": false
},
"value": null,
"typeAnnotation": null,
"isStatic": true,
"decorators": [],
"accessibility": "public",
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
},
{
"type": "ClassMethod",
"span": {
"start": 156,
"end": 187,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 170,
"end": 171,
"ctxt": 0
},
"value": "f",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 156,
"end": 187,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 174,
"end": 187,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 176,
"end": 185,
"ctxt": 0
},
"argument": {
"type": "StringLiteral",
"span": {
"start": 183,
"end": 185,
"ctxt": 0
},
"value": "",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": true,
"accessibility": "public",
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassProperty",
"span": {
"start": 193,
"end": 220,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 207,
"end": 208,
"ctxt": 0
},
"value": "g",
"optional": false
},
"value": {
"type": "ArrowFunctionExpression",
"span": {
"start": 211,
"end": 219,
"ctxt": 0
},
"params": [],
"body": {
"type": "StringLiteral",
"span": {
"start": 217,
"end": 219,
"ctxt": 0
},
"value": "",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
},
"typeAnnotation": null,
"isStatic": true,
"decorators": [],
"accessibility": "public",
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "VariableDeclaration",
"span": {
"start": 254,
"end": 270,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 258,
"end": 269,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 258,
"end": 259,
"ctxt": 0
},
"value": "c",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NewExpression",
"span": {
"start": 262,
"end": 269,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 266,
"end": 267,
"ctxt": 0
},
"value": "C",
"optional": false
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 272,
"end": 293,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 276,
"end": 292,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 276,
"end": 278,
"ctxt": 0
},
"value": "r1",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 278,
"end": 286,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 280,
"end": 286,
"ctxt": 0
},
"kind": "string"
}
}
},
"init": {
"type": "MemberExpression",
"span": {
"start": 289,
"end": 292,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 289,
"end": 290,
"ctxt": 0
},
"value": "c",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 291,
"end": 292,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 295,
"end": 316,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 299,
"end": 315,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 299,
"end": 301,
"ctxt": 0
},
"value": "r2",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 301,
"end": 309,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 303,
"end": 309,
"ctxt": 0
},
"kind": "string"
}
}
},
"init": {
"type": "MemberExpression",
"span": {
"start": 312,
"end": 315,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 312,
"end": 313,
"ctxt": 0
},
"value": "c",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 314,
"end": 315,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 318,
"end": 339,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 322,
"end": 338,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 322,
"end": 324,
"ctxt": 0
},
"value": "r3",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 324,
"end": 332,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 326,
"end": 332,
"ctxt": 0
},
"kind": "string"
}
}
},
"init": {
"type": "MemberExpression",
"span": {
"start": 335,
"end": 338,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 335,
"end": 336,
"ctxt": 0
},
"value": "c",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 337,
"end": 338,
"ctxt": 0
},
"value": "b",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 341,
"end": 364,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 345,
"end": 363,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 345,
"end": 347,
"ctxt": 0
},
"value": "r4",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 347,
"end": 355,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 349,
"end": 355,
"ctxt": 0
},
"kind": "string"
}
}
},
"init": {
"type": "CallExpression",
"span": {
"start": 358,
"end": 363,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 358,
"end": 361,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 358,
"end": 359,
"ctxt": 0
},
"value": "c",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 360,
"end": 361,
"ctxt": 0
},
"value": "c",
"optional": false
}
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 366,
"end": 389,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 370,
"end": 388,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 370,
"end": 372,
"ctxt": 0
},
"value": "r5",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 372,
"end": 380,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 374,
"end": 380,
"ctxt": 0
},
"kind": "string"
}
}
},
"init": {
"type": "CallExpression",
"span": {
"start": 383,
"end": 388,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 383,
"end": 386,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 383,
"end": 384,
"ctxt": 0
},
"value": "c",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 385,
"end": 386,
"ctxt": 0
},
"value": "d",
"optional": false
}
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 391,
"end": 412,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 395,
"end": 411,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 395,
"end": 397,
"ctxt": 0
},
"value": "r6",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 397,
"end": 405,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 399,
"end": 405,
"ctxt": 0
},
"kind": "string"
}
}
},
"init": {
"type": "MemberExpression",
"span": {
"start": 408,
"end": 411,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 408,
"end": 409,
"ctxt": 0
},
"value": "C",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 410,
"end": 411,
"ctxt": 0
},
"value": "e",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 414,
"end": 437,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 418,
"end": 436,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 418,
"end": 420,
"ctxt": 0
},
"value": "r7",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 420,
"end": 428,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 422,
"end": 428,
"ctxt": 0
},
"kind": "string"
}
}
},
"init": {
"type": "CallExpression",
"span": {
"start": 431,
"end": 436,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 431,
"end": 434,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 431,
"end": 432,
"ctxt": 0
},
"value": "C",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 433,
"end": 434,
"ctxt": 0
},
"value": "f",
"optional": false
}
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 439,
"end": 462,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 443,
"end": 461,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 443,
"end": 445,
"ctxt": 0
},
"value": "r8",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 445,
"end": 453,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 447,
"end": 453,
"ctxt": 0
},
"kind": "string"
}
}
},
"init": {
"type": "CallExpression",
"span": {
"start": 456,
"end": 461,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 456,
"end": 459,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 456,
"end": 457,
"ctxt": 0
},
"value": "C",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 458,
"end": 459,
"ctxt": 0
},
"value": "g",
"optional": false
}
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
}
],
"interpreter": null
}