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

995 lines
25 KiB
JSON

{
"type": "Script",
"span": {
"start": 81,
"end": 513,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 95,
"end": 96,
"ctxt": 0
},
"value": "B",
"optional": false
},
"declare": true,
"span": {
"start": 81,
"end": 175,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 103,
"end": 117,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 110,
"end": 111,
"ctxt": 0
},
"value": "a",
"optional": false
},
"value": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 111,
"end": 116,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 113,
"end": 116,
"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": 122,
"end": 141,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 129,
"end": 130,
"ctxt": 0
},
"value": "f",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 122,
"end": 141,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 132,
"end": 140,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 134,
"end": 140,
"ctxt": 0
},
"kind": "number"
}
}
},
"kind": "method",
"isStatic": true,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassProperty",
"span": {
"start": 146,
"end": 156,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 146,
"end": 147,
"ctxt": 0
},
"value": "a",
"optional": false
},
"value": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 147,
"end": 155,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 149,
"end": 155,
"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": 161,
"end": 173,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 161,
"end": 162,
"ctxt": 0
},
"value": "f",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 161,
"end": 173,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 164,
"end": 172,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 166,
"end": 172,
"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": 183,
"end": 184,
"ctxt": 0
},
"value": "C",
"optional": false
},
"declare": false,
"span": {
"start": 177,
"end": 513,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 201,
"end": 228,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 208,
"end": 209,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": {
"type": "TsNonNullExpression",
"span": {
"start": 217,
"end": 227,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 217,
"end": 226,
"ctxt": 0
},
"value": "undefined",
"optional": false
}
},
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 209,
"end": 214,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 211,
"end": 214,
"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": 233,
"end": 252,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 240,
"end": 242,
"ctxt": 0
},
"value": "y1",
"optional": false
},
"value": {
"type": "MemberExpression",
"span": {
"start": 245,
"end": 251,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 245,
"end": 249,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 250,
"end": 251,
"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": 257,
"end": 278,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 264,
"end": 266,
"ctxt": 0
},
"value": "y2",
"optional": false
},
"value": {
"type": "CallExpression",
"span": {
"start": 269,
"end": 277,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 269,
"end": 275,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 269,
"end": 273,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 274,
"end": 275,
"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": 283,
"end": 305,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 290,
"end": 292,
"ctxt": 0
},
"value": "y3",
"optional": false
},
"value": {
"type": "CallExpression",
"span": {
"start": 295,
"end": 304,
"ctxt": 0
},
"callee": {
"type": "OptionalChainingExpression",
"span": {
"start": 295,
"end": 302,
"ctxt": 0
},
"questionDotToken": {
"start": 299,
"end": 300,
"ctxt": 0
},
"base": {
"type": "MemberExpression",
"span": {
"start": 295,
"end": 302,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 295,
"end": 299,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 301,
"end": 302,
"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": 310,
"end": 336,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 317,
"end": 319,
"ctxt": 0
},
"value": "y4",
"optional": false
},
"value": {
"type": "CallExpression",
"span": {
"start": 322,
"end": 335,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 322,
"end": 333,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 322,
"end": 326,
"ctxt": 0
}
},
"property": {
"type": "Computed",
"span": {
"start": 326,
"end": 333,
"ctxt": 0
},
"expression": {
"type": "ParenthesisExpression",
"span": {
"start": 327,
"end": 332,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
"start": 328,
"end": 331,
"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": 341,
"end": 369,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 348,
"end": 350,
"ctxt": 0
},
"value": "y5",
"optional": false
},
"value": {
"type": "CallExpression",
"span": {
"start": 353,
"end": 368,
"ctxt": 0
},
"callee": {
"type": "OptionalChainingExpression",
"span": {
"start": 353,
"end": 366,
"ctxt": 0
},
"questionDotToken": {
"start": 357,
"end": 358,
"ctxt": 0
},
"base": {
"type": "MemberExpression",
"span": {
"start": 353,
"end": 366,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 353,
"end": 357,
"ctxt": 0
}
},
"property": {
"type": "Computed",
"span": {
"start": 359,
"end": 366,
"ctxt": 0
},
"expression": {
"type": "ParenthesisExpression",
"span": {
"start": 360,
"end": 365,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
"start": 361,
"end": 364,
"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": 374,
"end": 396,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 381,
"end": 383,
"ctxt": 0
},
"value": "z3",
"optional": false
},
"value": {
"type": "CallExpression",
"span": {
"start": 386,
"end": 395,
"ctxt": 0
},
"callee": {
"type": "SuperPropExpression",
"span": {
"start": 386,
"end": 393,
"ctxt": 0
},
"obj": {
"type": "Super",
"span": {
"start": 386,
"end": 391,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 392,
"end": 393,
"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": 401,
"end": 426,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 408,
"end": 410,
"ctxt": 0
},
"value": "z4",
"optional": false
},
"value": {
"type": "CallExpression",
"span": {
"start": 413,
"end": 425,
"ctxt": 0
},
"callee": {
"type": "SuperPropExpression",
"span": {
"start": 413,
"end": 423,
"ctxt": 0
},
"obj": {
"type": "Super",
"span": {
"start": 413,
"end": 418,
"ctxt": 0
}
},
"property": {
"type": "Computed",
"span": {
"start": 418,
"end": 423,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
"start": 419,
"end": 422,
"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": 470,
"end": 476,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 470,
"end": 471,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 474,
"end": 475,
"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": 481,
"end": 492,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 481,
"end": 482,
"ctxt": 0
},
"value": "y",
"optional": false
},
"value": {
"type": "MemberExpression",
"span": {
"start": 485,
"end": 491,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 485,
"end": 489,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 490,
"end": 491,
"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": 497,
"end": 511,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 497,
"end": 498,
"ctxt": 0
},
"value": "z",
"optional": false
},
"value": {
"type": "CallExpression",
"span": {
"start": 501,
"end": 510,
"ctxt": 0
},
"callee": {
"type": "SuperPropExpression",
"span": {
"start": 501,
"end": 508,
"ctxt": 0
},
"obj": {
"type": "Super",
"span": {
"start": 501,
"end": 506,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 507,
"end": 508,
"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": 193,
"end": 194,
"ctxt": 0
},
"value": "B",
"optional": false
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
}
],
"interpreter": null
}