swc/crates/swc_ecma_parser/tests/tsc/thisAndSuperInStaticMembers3.json
2022-04-05 12:46:35 +00:00

995 lines
25 KiB
JSON

{
"type": "Script",
"span": {
"start": 79,
"end": 511,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 93,
"end": 94,
"ctxt": 0
},
"value": "B",
"optional": false
},
"declare": true,
"span": {
"start": 79,
"end": 173,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 101,
"end": 115,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 108,
"end": 109,
"ctxt": 0
},
"value": "a",
"optional": false
},
"value": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 109,
"end": 114,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 111,
"end": 114,
"ctxt": 0
},
"kind": "any"
}
},
"isStatic": true,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
},
{
"type": "ClassMethod",
"span": {
"start": 120,
"end": 139,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 127,
"end": 128,
"ctxt": 0
},
"value": "f",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 120,
"end": 139,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 130,
"end": 138,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 132,
"end": 138,
"ctxt": 0
},
"kind": "number"
}
}
},
"kind": "method",
"isStatic": true,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassProperty",
"span": {
"start": 144,
"end": 154,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 144,
"end": 145,
"ctxt": 0
},
"value": "a",
"optional": false
},
"value": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 145,
"end": 153,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 147,
"end": 153,
"ctxt": 0
},
"kind": "number"
}
},
"isStatic": false,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
},
{
"type": "ClassMethod",
"span": {
"start": 159,
"end": 171,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 159,
"end": 160,
"ctxt": 0
},
"value": "f",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 159,
"end": 171,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 162,
"end": 170,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 164,
"end": 170,
"ctxt": 0
},
"kind": "number"
}
}
},
"kind": "method",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 181,
"end": 182,
"ctxt": 0
},
"value": "C",
"optional": false
},
"declare": false,
"span": {
"start": 175,
"end": 511,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 199,
"end": 226,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 206,
"end": 207,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": {
"type": "TsNonNullExpression",
"span": {
"start": 215,
"end": 225,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 215,
"end": 224,
"ctxt": 0
},
"value": "undefined",
"optional": false
}
},
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 207,
"end": 212,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 209,
"end": 212,
"ctxt": 0
},
"kind": "any"
}
},
"isStatic": true,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
},
{
"type": "ClassProperty",
"span": {
"start": 231,
"end": 250,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 238,
"end": 240,
"ctxt": 0
},
"value": "y1",
"optional": false
},
"value": {
"type": "MemberExpression",
"span": {
"start": 243,
"end": 249,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 243,
"end": 247,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 248,
"end": 249,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
"typeAnnotation": null,
"isStatic": true,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
},
{
"type": "ClassProperty",
"span": {
"start": 255,
"end": 276,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 262,
"end": 264,
"ctxt": 0
},
"value": "y2",
"optional": false
},
"value": {
"type": "CallExpression",
"span": {
"start": 267,
"end": 275,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 267,
"end": 273,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 267,
"end": 271,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 272,
"end": 273,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
"arguments": [],
"typeArguments": null
},
"typeAnnotation": null,
"isStatic": true,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
},
{
"type": "ClassProperty",
"span": {
"start": 281,
"end": 303,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 288,
"end": 290,
"ctxt": 0
},
"value": "y3",
"optional": false
},
"value": {
"type": "CallExpression",
"span": {
"start": 293,
"end": 302,
"ctxt": 0
},
"callee": {
"type": "OptionalChainingExpression",
"span": {
"start": 293,
"end": 300,
"ctxt": 0
},
"questionDotToken": {
"start": 297,
"end": 298,
"ctxt": 0
},
"base": {
"type": "MemberExpression",
"span": {
"start": 293,
"end": 300,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 293,
"end": 297,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 299,
"end": 300,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
},
"arguments": [],
"typeArguments": null
},
"typeAnnotation": null,
"isStatic": true,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
},
{
"type": "ClassProperty",
"span": {
"start": 308,
"end": 334,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 315,
"end": 317,
"ctxt": 0
},
"value": "y4",
"optional": false
},
"value": {
"type": "CallExpression",
"span": {
"start": 320,
"end": 333,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 320,
"end": 331,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 320,
"end": 324,
"ctxt": 0
}
},
"property": {
"type": "Computed",
"span": {
"start": 324,
"end": 331,
"ctxt": 0
},
"expression": {
"type": "ParenthesisExpression",
"span": {
"start": 325,
"end": 330,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
"start": 326,
"end": 329,
"ctxt": 0
},
"value": "x",
"raw": "\"x\""
}
}
}
},
"arguments": [],
"typeArguments": null
},
"typeAnnotation": null,
"isStatic": true,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
},
{
"type": "ClassProperty",
"span": {
"start": 339,
"end": 367,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 346,
"end": 348,
"ctxt": 0
},
"value": "y5",
"optional": false
},
"value": {
"type": "CallExpression",
"span": {
"start": 351,
"end": 366,
"ctxt": 0
},
"callee": {
"type": "OptionalChainingExpression",
"span": {
"start": 351,
"end": 364,
"ctxt": 0
},
"questionDotToken": {
"start": 355,
"end": 356,
"ctxt": 0
},
"base": {
"type": "MemberExpression",
"span": {
"start": 351,
"end": 364,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 351,
"end": 355,
"ctxt": 0
}
},
"property": {
"type": "Computed",
"span": {
"start": 357,
"end": 364,
"ctxt": 0
},
"expression": {
"type": "ParenthesisExpression",
"span": {
"start": 358,
"end": 363,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
"start": 359,
"end": 362,
"ctxt": 0
},
"value": "x",
"raw": "\"x\""
}
}
}
}
},
"arguments": [],
"typeArguments": null
},
"typeAnnotation": null,
"isStatic": true,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
},
{
"type": "ClassProperty",
"span": {
"start": 372,
"end": 394,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 379,
"end": 381,
"ctxt": 0
},
"value": "z3",
"optional": false
},
"value": {
"type": "CallExpression",
"span": {
"start": 384,
"end": 393,
"ctxt": 0
},
"callee": {
"type": "SuperPropExpression",
"span": {
"start": 384,
"end": 391,
"ctxt": 0
},
"obj": {
"type": "Super",
"span": {
"start": 384,
"end": 389,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 390,
"end": 391,
"ctxt": 0
},
"value": "f",
"optional": false
}
},
"arguments": [],
"typeArguments": null
},
"typeAnnotation": null,
"isStatic": true,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
},
{
"type": "ClassProperty",
"span": {
"start": 399,
"end": 424,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 406,
"end": 408,
"ctxt": 0
},
"value": "z4",
"optional": false
},
"value": {
"type": "CallExpression",
"span": {
"start": 411,
"end": 423,
"ctxt": 0
},
"callee": {
"type": "SuperPropExpression",
"span": {
"start": 411,
"end": 421,
"ctxt": 0
},
"obj": {
"type": "Super",
"span": {
"start": 411,
"end": 416,
"ctxt": 0
}
},
"property": {
"type": "Computed",
"span": {
"start": 416,
"end": 421,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
"start": 417,
"end": 420,
"ctxt": 0
},
"value": "f",
"raw": "\"f\""
}
}
},
"arguments": [],
"typeArguments": null
},
"typeAnnotation": null,
"isStatic": true,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
},
{
"type": "ClassProperty",
"span": {
"start": 468,
"end": 474,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 468,
"end": 469,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 472,
"end": 473,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
},
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
},
{
"type": "ClassProperty",
"span": {
"start": 479,
"end": 490,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 479,
"end": 480,
"ctxt": 0
},
"value": "y",
"optional": false
},
"value": {
"type": "MemberExpression",
"span": {
"start": 483,
"end": 489,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 483,
"end": 487,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 488,
"end": 489,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
},
{
"type": "ClassProperty",
"span": {
"start": 495,
"end": 509,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 495,
"end": 496,
"ctxt": 0
},
"value": "z",
"optional": false
},
"value": {
"type": "CallExpression",
"span": {
"start": 499,
"end": 508,
"ctxt": 0
},
"callee": {
"type": "SuperPropExpression",
"span": {
"start": 499,
"end": 506,
"ctxt": 0
},
"obj": {
"type": "Super",
"span": {
"start": 499,
"end": 504,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 505,
"end": 506,
"ctxt": 0
},
"value": "f",
"optional": false
}
},
"arguments": [],
"typeArguments": null
},
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
}
],
"superClass": {
"type": "Identifier",
"span": {
"start": 191,
"end": 192,
"ctxt": 0
},
"value": "B",
"optional": false
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
}
],
"interpreter": null
}