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

1501 lines
38 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 198,
"end": 1053,
"ctxt": 0
},
"body": [
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 207,
"end": 215,
"ctxt": 0
},
"value": "Multimap",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 216,
"end": 218,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 216,
"end": 218,
"ctxt": 0
},
"value": "ik",
"optional": false,
"typeAnnotation": null
}
},
{
"type": "Parameter",
"span": {
"start": 220,
"end": 222,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 220,
"end": 222,
"ctxt": 0
},
"value": "iv",
"optional": false,
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 198,
"end": 347,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 224,
"end": 347,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 268,
"end": 283,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 268,
"end": 282,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 268,
"end": 277,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 268,
"end": 272,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 273,
"end": 277,
"ctxt": 0
},
"value": "_map",
"optional": false
}
},
"right": {
"type": "ObjectExpression",
"span": {
"start": 280,
"end": 282,
"ctxt": 0
},
"properties": []
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 319,
"end": 345,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 319,
"end": 344,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 319,
"end": 329,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 319,
"end": 323,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 324,
"end": 329,
"ctxt": 0
},
"value": "_map2",
"optional": false
}
},
"right": {
"type": "ObjectExpression",
"span": {
"start": 332,
"end": 344,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Computed",
"span": {
"start": 334,
"end": 338,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 335,
"end": 337,
"ctxt": 0
},
"value": "ik",
"optional": false
}
},
"value": {
"type": "Identifier",
"span": {
"start": 340,
"end": 342,
"ctxt": 0
},
"value": "iv",
"optional": false
}
}
]
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "EmptyStatement",
"span": {
"start": 347,
"end": 348,
"ctxt": 0
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 414,
"end": 447,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 420,
"end": 446,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 420,
"end": 423,
"ctxt": 0
},
"value": "map",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NewExpression",
"span": {
"start": 426,
"end": 446,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 430,
"end": 438,
"ctxt": 0
},
"value": "Multimap",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 439,
"end": 442,
"ctxt": 0
},
"value": "a",
"raw": "\"a\""
}
},
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 444,
"end": 445,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 475,
"end": 509,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 481,
"end": 508,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 481,
"end": 485,
"ctxt": 0
},
"value": "map2",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NewExpression",
"span": {
"start": 488,
"end": 508,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 492,
"end": 500,
"ctxt": 0
},
"value": "Multimap",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 501,
"end": 504,
"ctxt": 0
},
"value": "m",
"raw": "\"m\""
}
},
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 506,
"end": 507,
"ctxt": 0
},
"value": 2.0,
"raw": "2"
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 533,
"end": 555,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 537,
"end": 555,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 537,
"end": 538,
"ctxt": 0
},
"value": "n",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 541,
"end": 555,
"ctxt": 0
},
"object": {
"type": "MemberExpression",
"span": {
"start": 541,
"end": 549,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 541,
"end": 544,
"ctxt": 0
},
"value": "map",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 545,
"end": 549,
"ctxt": 0
},
"value": "_map",
"optional": false
}
},
"property": {
"type": "Computed",
"span": {
"start": 549,
"end": 555,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
"start": 550,
"end": 554,
"ctxt": 0
},
"value": "hi",
"raw": "'hi'"
}
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 578,
"end": 601,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 582,
"end": 601,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 582,
"end": 583,
"ctxt": 0
},
"value": "n",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 586,
"end": 601,
"ctxt": 0
},
"object": {
"type": "MemberExpression",
"span": {
"start": 586,
"end": 595,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 586,
"end": 589,
"ctxt": 0
},
"value": "map",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 590,
"end": 595,
"ctxt": 0
},
"value": "_map2",
"optional": false
}
},
"property": {
"type": "Computed",
"span": {
"start": 595,
"end": 601,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
"start": 596,
"end": 600,
"ctxt": 0
},
"value": "hi",
"raw": "'hi'"
}
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 624,
"end": 647,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 628,
"end": 647,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 628,
"end": 629,
"ctxt": 0
},
"value": "n",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 632,
"end": 647,
"ctxt": 0
},
"object": {
"type": "MemberExpression",
"span": {
"start": 632,
"end": 641,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 632,
"end": 636,
"ctxt": 0
},
"value": "map2",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 637,
"end": 641,
"ctxt": 0
},
"value": "_map",
"optional": false
}
},
"property": {
"type": "Computed",
"span": {
"start": 641,
"end": 647,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
"start": 642,
"end": 646,
"ctxt": 0
},
"value": "hi",
"raw": "'hi'"
}
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 670,
"end": 693,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 674,
"end": 693,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 674,
"end": 675,
"ctxt": 0
},
"value": "n",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 678,
"end": 693,
"ctxt": 0
},
"object": {
"type": "MemberExpression",
"span": {
"start": 678,
"end": 687,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 678,
"end": 681,
"ctxt": 0
},
"value": "map",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 682,
"end": 687,
"ctxt": 0
},
"value": "_map2",
"optional": false
}
},
"property": {
"type": "Computed",
"span": {
"start": 687,
"end": 693,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
"start": 688,
"end": 692,
"ctxt": 0
},
"value": "hi",
"raw": "'hi'"
}
}
},
"definite": false
}
]
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 753,
"end": 755,
"ctxt": 0
},
"value": "Cp",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 756,
"end": 757,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 756,
"end": 757,
"ctxt": 0
},
"value": "t",
"optional": false,
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 744,
"end": 792,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 759,
"end": 792,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 765,
"end": 775,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 765,
"end": 775,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 765,
"end": 771,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 765,
"end": 769,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 770,
"end": 771,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 774,
"end": 775,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 780,
"end": 790,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 780,
"end": 790,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 780,
"end": 786,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 780,
"end": 784,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 785,
"end": 786,
"ctxt": 0
},
"value": "y",
"optional": false
}
},
"right": {
"type": "Identifier",
"span": {
"start": 789,
"end": 790,
"ctxt": 0
},
"value": "t",
"optional": false
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "ExpressionStatement",
"span": {
"start": 793,
"end": 887,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 793,
"end": 887,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 793,
"end": 805,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 793,
"end": 795,
"ctxt": 0
},
"value": "Cp",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 796,
"end": 805,
"ctxt": 0
},
"value": "prototype",
"optional": false
}
},
"right": {
"type": "ObjectExpression",
"span": {
"start": 808,
"end": 887,
"ctxt": 0
},
"properties": [
{
"type": "MethodProperty",
"key": {
"type": "Identifier",
"span": {
"start": 814,
"end": 816,
"ctxt": 0
},
"value": "m1",
"optional": false
},
"params": [],
"decorators": [],
"span": {
"start": 814,
"end": 836,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 819,
"end": 836,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 821,
"end": 834,
"ctxt": 0
},
"argument": {
"type": "MemberExpression",
"span": {
"start": 828,
"end": 834,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 828,
"end": 832,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 833,
"end": 834,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "MethodProperty",
"key": {
"type": "Identifier",
"span": {
"start": 842,
"end": 844,
"ctxt": 0
},
"value": "m2",
"optional": false
},
"params": [],
"decorators": [],
"span": {
"start": 842,
"end": 885,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 847,
"end": 885,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 849,
"end": 869,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 849,
"end": 868,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 849,
"end": 855,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 849,
"end": 853,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 854,
"end": 855,
"ctxt": 0
},
"value": "z",
"optional": false
}
},
"right": {
"type": "BinaryExpression",
"span": {
"start": 858,
"end": 868,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "MemberExpression",
"span": {
"start": 858,
"end": 864,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 858,
"end": 862,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 863,
"end": 864,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 867,
"end": 868,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
}
},
{
"type": "ReturnStatement",
"span": {
"start": 870,
"end": 883,
"ctxt": 0
},
"argument": {
"type": "MemberExpression",
"span": {
"start": 877,
"end": 883,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 877,
"end": 881,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 882,
"end": 883,
"ctxt": 0
},
"value": "y",
"optional": false
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
]
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 888,
"end": 906,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 892,
"end": 906,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 892,
"end": 894,
"ctxt": 0
},
"value": "cp",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NewExpression",
"span": {
"start": 897,
"end": 906,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 901,
"end": 903,
"ctxt": 0
},
"value": "Cp",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 904,
"end": 905,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 930,
"end": 942,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 934,
"end": 942,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 934,
"end": 935,
"ctxt": 0
},
"value": "n",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 938,
"end": 942,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 938,
"end": 940,
"ctxt": 0
},
"value": "cp",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 941,
"end": 942,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 965,
"end": 977,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 969,
"end": 977,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 969,
"end": 970,
"ctxt": 0
},
"value": "n",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 973,
"end": 977,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 973,
"end": 975,
"ctxt": 0
},
"value": "cp",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 976,
"end": 977,
"ctxt": 0
},
"value": "y",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 1000,
"end": 1015,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 1004,
"end": 1015,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1004,
"end": 1005,
"ctxt": 0
},
"value": "n",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 1008,
"end": 1015,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 1008,
"end": 1013,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 1008,
"end": 1010,
"ctxt": 0
},
"value": "cp",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 1011,
"end": 1013,
"ctxt": 0
},
"value": "m1",
"optional": false
}
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 1038,
"end": 1053,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 1042,
"end": 1053,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1042,
"end": 1043,
"ctxt": 0
},
"value": "n",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 1046,
"end": 1053,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 1046,
"end": 1051,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 1046,
"end": 1048,
"ctxt": 0
},
"value": "cp",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 1049,
"end": 1051,
"ctxt": 0
},
"value": "m2",
"optional": false
}
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
}
],
"interpreter": null
}