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

1449 lines
32 KiB
JSON

{
"type": "Module",
"span": {
"start": 55,
"end": 674,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 55,
"end": 74,
"ctxt": 0
},
"declaration": {
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 68,
"end": 70,
"ctxt": 0
},
"value": "C1",
"optional": false
},
"declare": false,
"span": {
"start": 62,
"end": 74,
"ctxt": 0
},
"decorators": [],
"body": [],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 75,
"end": 93,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 75,
"end": 92,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 75,
"end": 88,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 75,
"end": 77,
"ctxt": 0
},
"value": "C1",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 78,
"end": 88,
"ctxt": 0
},
"value": "staticProp",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 91,
"end": 92,
"ctxt": 0
},
"value": 0.0
}
}
},
{
"type": "ExportDeclaration",
"span": {
"start": 95,
"end": 119,
"ctxt": 0
},
"declaration": {
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 111,
"end": 113,
"ctxt": 0
},
"value": "F1",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 102,
"end": 119,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 116,
"end": 119,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 120,
"end": 138,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 120,
"end": 137,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 120,
"end": 133,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 120,
"end": 122,
"ctxt": 0
},
"value": "F1",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 123,
"end": 133,
"ctxt": 0
},
"value": "staticProp",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 136,
"end": 137,
"ctxt": 0
},
"value": 0.0
}
}
},
{
"type": "ExportDeclaration",
"span": {
"start": 140,
"end": 166,
"ctxt": 0
},
"declaration": {
"type": "VariableDeclaration",
"span": {
"start": 147,
"end": 166,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 151,
"end": 165,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 151,
"end": 153,
"ctxt": 0
},
"value": "C2",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ClassExpression",
"identifier": null,
"span": {
"start": 156,
"end": 165,
"ctxt": 0
},
"decorators": [],
"body": [],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
"definite": false
}
]
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 167,
"end": 185,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 167,
"end": 184,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 167,
"end": 180,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 167,
"end": 169,
"ctxt": 0
},
"value": "C2",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 170,
"end": 180,
"ctxt": 0
},
"value": "staticProp",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 183,
"end": 184,
"ctxt": 0
},
"value": 0.0
}
}
},
{
"type": "ExportDeclaration",
"span": {
"start": 187,
"end": 219,
"ctxt": 0
},
"declaration": {
"type": "VariableDeclaration",
"span": {
"start": 194,
"end": 219,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 198,
"end": 218,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 198,
"end": 200,
"ctxt": 0
},
"value": "F2",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "FunctionExpression",
"identifier": null,
"params": [],
"decorators": [],
"span": {
"start": 203,
"end": 218,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 215,
"end": 218,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"definite": false
}
]
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 220,
"end": 238,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 220,
"end": 237,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 220,
"end": 233,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 220,
"end": 222,
"ctxt": 0
},
"value": "F2",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 223,
"end": 233,
"ctxt": 0
},
"value": "staticProp",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 236,
"end": 237,
"ctxt": 0
},
"value": 0.0
}
}
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 269,
"end": 271,
"ctxt": 0
},
"value": "C3",
"optional": false
},
"declare": false,
"span": {
"start": 263,
"end": 275,
"ctxt": 0
},
"decorators": [],
"body": [],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "ExpressionStatement",
"span": {
"start": 276,
"end": 294,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 276,
"end": 293,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 276,
"end": 289,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 276,
"end": 278,
"ctxt": 0
},
"value": "C3",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 279,
"end": 289,
"ctxt": 0
},
"value": "staticProp",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 292,
"end": 293,
"ctxt": 0
},
"value": 0.0
}
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 305,
"end": 307,
"ctxt": 0
},
"value": "F3",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 296,
"end": 313,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 310,
"end": 313,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "ExpressionStatement",
"span": {
"start": 314,
"end": 332,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 314,
"end": 331,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 314,
"end": 327,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 314,
"end": 316,
"ctxt": 0
},
"value": "F3",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 317,
"end": 327,
"ctxt": 0
},
"value": "staticProp",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 330,
"end": 331,
"ctxt": 0
},
"value": 0.0
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 334,
"end": 353,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 338,
"end": 352,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 338,
"end": 340,
"ctxt": 0
},
"value": "C4",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ClassExpression",
"identifier": null,
"span": {
"start": 343,
"end": 352,
"ctxt": 0
},
"decorators": [],
"body": [],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 354,
"end": 372,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 354,
"end": 371,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 354,
"end": 367,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 354,
"end": 356,
"ctxt": 0
},
"value": "C4",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 357,
"end": 367,
"ctxt": 0
},
"value": "staticProp",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 370,
"end": 371,
"ctxt": 0
},
"value": 0.0
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 374,
"end": 399,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 378,
"end": 398,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 378,
"end": 380,
"ctxt": 0
},
"value": "F4",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "FunctionExpression",
"identifier": null,
"params": [],
"decorators": [],
"span": {
"start": 383,
"end": 398,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 395,
"end": 398,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 400,
"end": 418,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 400,
"end": 417,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 400,
"end": 413,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 400,
"end": 402,
"ctxt": 0
},
"value": "F4",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 403,
"end": 413,
"ctxt": 0
},
"value": "staticProp",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 416,
"end": 417,
"ctxt": 0
},
"value": 0.0
}
}
},
{
"type": "ImportDeclaration",
"span": {
"start": 439,
"end": 464,
"ctxt": 0
},
"specifiers": [
{
"type": "ImportNamespaceSpecifier",
"span": {
"start": 446,
"end": 452,
"ctxt": 0
},
"local": {
"type": "Identifier",
"span": {
"start": 451,
"end": 452,
"ctxt": 0
},
"value": "a",
"optional": false
}
}
],
"source": {
"type": "StringLiteral",
"span": {
"start": 458,
"end": 463,
"ctxt": 0
},
"value": "./a",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
},
"typeOnly": false,
"asserts": null
},
{
"type": "VariableDeclaration",
"span": {
"start": 465,
"end": 479,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 469,
"end": 478,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 469,
"end": 470,
"ctxt": 0
},
"value": "n",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 470,
"end": 478,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 472,
"end": 478,
"ctxt": 0
},
"kind": "number"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 481,
"end": 505,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 485,
"end": 504,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 485,
"end": 486,
"ctxt": 0
},
"value": "n",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 489,
"end": 504,
"ctxt": 0
},
"object": {
"type": "MemberExpression",
"span": {
"start": 489,
"end": 493,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 489,
"end": 490,
"ctxt": 0
},
"value": "a",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 491,
"end": 493,
"ctxt": 0
},
"value": "C1",
"optional": false
}
},
"property": {
"type": "Identifier",
"span": {
"start": 494,
"end": 504,
"ctxt": 0
},
"value": "staticProp",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 506,
"end": 530,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 510,
"end": 529,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 510,
"end": 511,
"ctxt": 0
},
"value": "n",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 514,
"end": 529,
"ctxt": 0
},
"object": {
"type": "MemberExpression",
"span": {
"start": 514,
"end": 518,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 514,
"end": 515,
"ctxt": 0
},
"value": "a",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 516,
"end": 518,
"ctxt": 0
},
"value": "C2",
"optional": false
}
},
"property": {
"type": "Identifier",
"span": {
"start": 519,
"end": 529,
"ctxt": 0
},
"value": "staticProp",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 531,
"end": 555,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 535,
"end": 554,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 535,
"end": 536,
"ctxt": 0
},
"value": "n",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 539,
"end": 554,
"ctxt": 0
},
"object": {
"type": "MemberExpression",
"span": {
"start": 539,
"end": 543,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 539,
"end": 540,
"ctxt": 0
},
"value": "a",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 541,
"end": 543,
"ctxt": 0
},
"value": "F1",
"optional": false
}
},
"property": {
"type": "Identifier",
"span": {
"start": 544,
"end": 554,
"ctxt": 0
},
"value": "staticProp",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 556,
"end": 580,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 560,
"end": 579,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 560,
"end": 561,
"ctxt": 0
},
"value": "n",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 564,
"end": 579,
"ctxt": 0
},
"object": {
"type": "MemberExpression",
"span": {
"start": 564,
"end": 568,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 564,
"end": 565,
"ctxt": 0
},
"value": "a",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 566,
"end": 568,
"ctxt": 0
},
"value": "F2",
"optional": false
}
},
"property": {
"type": "Identifier",
"span": {
"start": 569,
"end": 579,
"ctxt": 0
},
"value": "staticProp",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 583,
"end": 605,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 587,
"end": 604,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 587,
"end": 588,
"ctxt": 0
},
"value": "n",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 591,
"end": 604,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 591,
"end": 593,
"ctxt": 0
},
"value": "C3",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 594,
"end": 604,
"ctxt": 0
},
"value": "staticProp",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 606,
"end": 628,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 610,
"end": 627,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 610,
"end": 611,
"ctxt": 0
},
"value": "n",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 614,
"end": 627,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 614,
"end": 616,
"ctxt": 0
},
"value": "C4",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 617,
"end": 627,
"ctxt": 0
},
"value": "staticProp",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 629,
"end": 651,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 633,
"end": 650,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 633,
"end": 634,
"ctxt": 0
},
"value": "n",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 637,
"end": 650,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 637,
"end": 639,
"ctxt": 0
},
"value": "F3",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 640,
"end": 650,
"ctxt": 0
},
"value": "staticProp",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 652,
"end": 674,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 656,
"end": 673,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 656,
"end": 657,
"ctxt": 0
},
"value": "n",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 660,
"end": 673,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 660,
"end": 662,
"ctxt": 0
},
"value": "F4",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 663,
"end": 673,
"ctxt": 0
},
"value": "staticProp",
"optional": false
}
},
"definite": false
}
]
}
],
"interpreter": null
}