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

1453 lines
32 KiB
JSON

{
"type": "Module",
"span": {
"start": 56,
"end": 675,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 56,
"end": 75,
"ctxt": 0
},
"declaration": {
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 69,
"end": 71,
"ctxt": 0
},
"value": "C1",
"optional": false
},
"declare": false,
"span": {
"start": 63,
"end": 75,
"ctxt": 0
},
"decorators": [],
"body": [],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 76,
"end": 94,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 76,
"end": 93,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 76,
"end": 89,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 76,
"end": 78,
"ctxt": 0
},
"value": "C1",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 79,
"end": 89,
"ctxt": 0
},
"value": "staticProp",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 92,
"end": 93,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
}
},
{
"type": "ExportDeclaration",
"span": {
"start": 96,
"end": 120,
"ctxt": 0
},
"declaration": {
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 112,
"end": 114,
"ctxt": 0
},
"value": "F1",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 103,
"end": 120,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 117,
"end": 120,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 121,
"end": 139,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 121,
"end": 138,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 121,
"end": 134,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 121,
"end": 123,
"ctxt": 0
},
"value": "F1",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 124,
"end": 134,
"ctxt": 0
},
"value": "staticProp",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 137,
"end": 138,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
}
},
{
"type": "ExportDeclaration",
"span": {
"start": 141,
"end": 167,
"ctxt": 0
},
"declaration": {
"type": "VariableDeclaration",
"span": {
"start": 148,
"end": 167,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 152,
"end": 166,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 152,
"end": 154,
"ctxt": 0
},
"value": "C2",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ClassExpression",
"identifier": null,
"span": {
"start": 157,
"end": 166,
"ctxt": 0
},
"decorators": [],
"body": [],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
"definite": false
}
]
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 168,
"end": 186,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 168,
"end": 185,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 168,
"end": 181,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 168,
"end": 170,
"ctxt": 0
},
"value": "C2",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 171,
"end": 181,
"ctxt": 0
},
"value": "staticProp",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 184,
"end": 185,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
}
},
{
"type": "ExportDeclaration",
"span": {
"start": 188,
"end": 220,
"ctxt": 0
},
"declaration": {
"type": "VariableDeclaration",
"span": {
"start": 195,
"end": 220,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 199,
"end": 219,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 199,
"end": 201,
"ctxt": 0
},
"value": "F2",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "FunctionExpression",
"identifier": null,
"params": [],
"decorators": [],
"span": {
"start": 204,
"end": 219,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 216,
"end": 219,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"definite": false
}
]
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 221,
"end": 239,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 221,
"end": 238,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 221,
"end": 234,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 221,
"end": 223,
"ctxt": 0
},
"value": "F2",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 224,
"end": 234,
"ctxt": 0
},
"value": "staticProp",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 237,
"end": 238,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
}
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 270,
"end": 272,
"ctxt": 0
},
"value": "C3",
"optional": false
},
"declare": false,
"span": {
"start": 264,
"end": 276,
"ctxt": 0
},
"decorators": [],
"body": [],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "ExpressionStatement",
"span": {
"start": 277,
"end": 295,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 277,
"end": 294,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 277,
"end": 290,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 277,
"end": 279,
"ctxt": 0
},
"value": "C3",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 280,
"end": 290,
"ctxt": 0
},
"value": "staticProp",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 293,
"end": 294,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 306,
"end": 308,
"ctxt": 0
},
"value": "F3",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 297,
"end": 314,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 311,
"end": 314,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "ExpressionStatement",
"span": {
"start": 315,
"end": 333,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 315,
"end": 332,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 315,
"end": 328,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 315,
"end": 317,
"ctxt": 0
},
"value": "F3",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 318,
"end": 328,
"ctxt": 0
},
"value": "staticProp",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 331,
"end": 332,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 335,
"end": 354,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 339,
"end": 353,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 339,
"end": 341,
"ctxt": 0
},
"value": "C4",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ClassExpression",
"identifier": null,
"span": {
"start": 344,
"end": 353,
"ctxt": 0
},
"decorators": [],
"body": [],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 355,
"end": 373,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 355,
"end": 372,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 355,
"end": 368,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 355,
"end": 357,
"ctxt": 0
},
"value": "C4",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 358,
"end": 368,
"ctxt": 0
},
"value": "staticProp",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 371,
"end": 372,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 375,
"end": 400,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 379,
"end": 399,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 379,
"end": 381,
"ctxt": 0
},
"value": "F4",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "FunctionExpression",
"identifier": null,
"params": [],
"decorators": [],
"span": {
"start": 384,
"end": 399,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 396,
"end": 399,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 401,
"end": 419,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 401,
"end": 418,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 401,
"end": 414,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 401,
"end": 403,
"ctxt": 0
},
"value": "F4",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 404,
"end": 414,
"ctxt": 0
},
"value": "staticProp",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 417,
"end": 418,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
}
},
{
"type": "ImportDeclaration",
"span": {
"start": 440,
"end": 465,
"ctxt": 0
},
"specifiers": [
{
"type": "ImportNamespaceSpecifier",
"span": {
"start": 447,
"end": 453,
"ctxt": 0
},
"local": {
"type": "Identifier",
"span": {
"start": 452,
"end": 453,
"ctxt": 0
},
"value": "a",
"optional": false
}
}
],
"source": {
"type": "StringLiteral",
"span": {
"start": 459,
"end": 464,
"ctxt": 0
},
"value": "./a",
"raw": "\"./a\""
},
"typeOnly": false,
"asserts": null
},
{
"type": "VariableDeclaration",
"span": {
"start": 466,
"end": 480,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 470,
"end": 479,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 470,
"end": 471,
"ctxt": 0
},
"value": "n",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 471,
"end": 479,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 473,
"end": 479,
"ctxt": 0
},
"kind": "number"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 482,
"end": 506,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 486,
"end": 505,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 486,
"end": 487,
"ctxt": 0
},
"value": "n",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 490,
"end": 505,
"ctxt": 0
},
"object": {
"type": "MemberExpression",
"span": {
"start": 490,
"end": 494,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 490,
"end": 491,
"ctxt": 0
},
"value": "a",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 492,
"end": 494,
"ctxt": 0
},
"value": "C1",
"optional": false
}
},
"property": {
"type": "Identifier",
"span": {
"start": 495,
"end": 505,
"ctxt": 0
},
"value": "staticProp",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 507,
"end": 531,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 511,
"end": 530,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 511,
"end": 512,
"ctxt": 0
},
"value": "n",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 515,
"end": 530,
"ctxt": 0
},
"object": {
"type": "MemberExpression",
"span": {
"start": 515,
"end": 519,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 515,
"end": 516,
"ctxt": 0
},
"value": "a",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 517,
"end": 519,
"ctxt": 0
},
"value": "C2",
"optional": false
}
},
"property": {
"type": "Identifier",
"span": {
"start": 520,
"end": 530,
"ctxt": 0
},
"value": "staticProp",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 532,
"end": 556,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 536,
"end": 555,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 536,
"end": 537,
"ctxt": 0
},
"value": "n",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 540,
"end": 555,
"ctxt": 0
},
"object": {
"type": "MemberExpression",
"span": {
"start": 540,
"end": 544,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 540,
"end": 541,
"ctxt": 0
},
"value": "a",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 542,
"end": 544,
"ctxt": 0
},
"value": "F1",
"optional": false
}
},
"property": {
"type": "Identifier",
"span": {
"start": 545,
"end": 555,
"ctxt": 0
},
"value": "staticProp",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 557,
"end": 581,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 561,
"end": 580,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 561,
"end": 562,
"ctxt": 0
},
"value": "n",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 565,
"end": 580,
"ctxt": 0
},
"object": {
"type": "MemberExpression",
"span": {
"start": 565,
"end": 569,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 565,
"end": 566,
"ctxt": 0
},
"value": "a",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 567,
"end": 569,
"ctxt": 0
},
"value": "F2",
"optional": false
}
},
"property": {
"type": "Identifier",
"span": {
"start": 570,
"end": 580,
"ctxt": 0
},
"value": "staticProp",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 584,
"end": 606,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 588,
"end": 605,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 588,
"end": 589,
"ctxt": 0
},
"value": "n",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 592,
"end": 605,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 592,
"end": 594,
"ctxt": 0
},
"value": "C3",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 595,
"end": 605,
"ctxt": 0
},
"value": "staticProp",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 607,
"end": 629,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 611,
"end": 628,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 611,
"end": 612,
"ctxt": 0
},
"value": "n",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 615,
"end": 628,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 615,
"end": 617,
"ctxt": 0
},
"value": "C4",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 618,
"end": 628,
"ctxt": 0
},
"value": "staticProp",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 630,
"end": 652,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 634,
"end": 651,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 634,
"end": 635,
"ctxt": 0
},
"value": "n",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 638,
"end": 651,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 638,
"end": 640,
"ctxt": 0
},
"value": "F3",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 641,
"end": 651,
"ctxt": 0
},
"value": "staticProp",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 653,
"end": 675,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 657,
"end": 674,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 657,
"end": 658,
"ctxt": 0
},
"value": "n",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 661,
"end": 674,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 661,
"end": 663,
"ctxt": 0
},
"value": "F4",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 664,
"end": 674,
"ctxt": 0
},
"value": "staticProp",
"optional": false
}
},
"definite": false
}
]
}
],
"interpreter": null
}