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

1520 lines
38 KiB
JSON

{
"type": "Script",
"span": {
"start": 197,
"end": 1052,
"ctxt": 0
},
"body": [
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 206,
"end": 214,
"ctxt": 0
},
"value": "Multimap",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 215,
"end": 217,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 215,
"end": 217,
"ctxt": 0
},
"value": "ik",
"optional": false,
"typeAnnotation": null
}
},
{
"type": "Parameter",
"span": {
"start": 219,
"end": 221,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 219,
"end": 221,
"ctxt": 0
},
"value": "iv",
"optional": false,
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 197,
"end": 346,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 223,
"end": 346,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 267,
"end": 282,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 267,
"end": 281,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 267,
"end": 276,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 267,
"end": 271,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 272,
"end": 276,
"ctxt": 0
},
"value": "_map",
"optional": false
}
},
"right": {
"type": "ObjectExpression",
"span": {
"start": 279,
"end": 281,
"ctxt": 0
},
"properties": []
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 318,
"end": 344,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 318,
"end": 343,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 318,
"end": 328,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 318,
"end": 322,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 323,
"end": 328,
"ctxt": 0
},
"value": "_map2",
"optional": false
}
},
"right": {
"type": "ObjectExpression",
"span": {
"start": 331,
"end": 343,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Computed",
"span": {
"start": 333,
"end": 337,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 334,
"end": 336,
"ctxt": 0
},
"value": "ik",
"optional": false
}
},
"value": {
"type": "Identifier",
"span": {
"start": 339,
"end": 341,
"ctxt": 0
},
"value": "iv",
"optional": false
}
}
]
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "EmptyStatement",
"span": {
"start": 346,
"end": 347,
"ctxt": 0
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 413,
"end": 446,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 419,
"end": 445,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 419,
"end": 422,
"ctxt": 0
},
"value": "map",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NewExpression",
"span": {
"start": 425,
"end": 445,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 429,
"end": 437,
"ctxt": 0
},
"value": "Multimap",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 438,
"end": 441,
"ctxt": 0
},
"value": "a",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
},
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 443,
"end": 444,
"ctxt": 0
},
"value": 1.0
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 474,
"end": 508,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 480,
"end": 507,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 480,
"end": 484,
"ctxt": 0
},
"value": "map2",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NewExpression",
"span": {
"start": 487,
"end": 507,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 491,
"end": 499,
"ctxt": 0
},
"value": "Multimap",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 500,
"end": 503,
"ctxt": 0
},
"value": "m",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
},
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 505,
"end": 506,
"ctxt": 0
},
"value": 2.0
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 532,
"end": 554,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 536,
"end": 554,
"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": 554,
"ctxt": 0
},
"object": {
"type": "MemberExpression",
"span": {
"start": 540,
"end": 548,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 540,
"end": 543,
"ctxt": 0
},
"value": "map",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 544,
"end": 548,
"ctxt": 0
},
"value": "_map",
"optional": false
}
},
"property": {
"type": "Computed",
"span": {
"start": 548,
"end": 554,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
"start": 549,
"end": 553,
"ctxt": 0
},
"value": "hi",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 577,
"end": 600,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 581,
"end": 600,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 581,
"end": 582,
"ctxt": 0
},
"value": "n",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 585,
"end": 600,
"ctxt": 0
},
"object": {
"type": "MemberExpression",
"span": {
"start": 585,
"end": 594,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 585,
"end": 588,
"ctxt": 0
},
"value": "map",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 589,
"end": 594,
"ctxt": 0
},
"value": "_map2",
"optional": false
}
},
"property": {
"type": "Computed",
"span": {
"start": 594,
"end": 600,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
"start": 595,
"end": 599,
"ctxt": 0
},
"value": "hi",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 623,
"end": 646,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 627,
"end": 646,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 627,
"end": 628,
"ctxt": 0
},
"value": "n",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 631,
"end": 646,
"ctxt": 0
},
"object": {
"type": "MemberExpression",
"span": {
"start": 631,
"end": 640,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 631,
"end": 635,
"ctxt": 0
},
"value": "map2",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 636,
"end": 640,
"ctxt": 0
},
"value": "_map",
"optional": false
}
},
"property": {
"type": "Computed",
"span": {
"start": 640,
"end": 646,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
"start": 641,
"end": 645,
"ctxt": 0
},
"value": "hi",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 669,
"end": 692,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 673,
"end": 692,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 673,
"end": 674,
"ctxt": 0
},
"value": "n",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 677,
"end": 692,
"ctxt": 0
},
"object": {
"type": "MemberExpression",
"span": {
"start": 677,
"end": 686,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 677,
"end": 680,
"ctxt": 0
},
"value": "map",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 681,
"end": 686,
"ctxt": 0
},
"value": "_map2",
"optional": false
}
},
"property": {
"type": "Computed",
"span": {
"start": 686,
"end": 692,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
"start": 687,
"end": 691,
"ctxt": 0
},
"value": "hi",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
},
"definite": false
}
]
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 752,
"end": 754,
"ctxt": 0
},
"value": "Cp",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 755,
"end": 756,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 755,
"end": 756,
"ctxt": 0
},
"value": "t",
"optional": false,
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 743,
"end": 791,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 758,
"end": 791,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 764,
"end": 774,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 764,
"end": 774,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 764,
"end": 770,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 764,
"end": 768,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 769,
"end": 770,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 773,
"end": 774,
"ctxt": 0
},
"value": 1.0
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 779,
"end": 789,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 779,
"end": 789,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 779,
"end": 785,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 779,
"end": 783,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 784,
"end": 785,
"ctxt": 0
},
"value": "y",
"optional": false
}
},
"right": {
"type": "Identifier",
"span": {
"start": 788,
"end": 789,
"ctxt": 0
},
"value": "t",
"optional": false
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "ExpressionStatement",
"span": {
"start": 792,
"end": 886,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 792,
"end": 886,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 792,
"end": 804,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 792,
"end": 794,
"ctxt": 0
},
"value": "Cp",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 795,
"end": 804,
"ctxt": 0
},
"value": "prototype",
"optional": false
}
},
"right": {
"type": "ObjectExpression",
"span": {
"start": 807,
"end": 886,
"ctxt": 0
},
"properties": [
{
"type": "MethodProperty",
"key": {
"type": "Identifier",
"span": {
"start": 813,
"end": 815,
"ctxt": 0
},
"value": "m1",
"optional": false
},
"params": [],
"decorators": [],
"span": {
"start": 813,
"end": 835,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 818,
"end": 835,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 820,
"end": 833,
"ctxt": 0
},
"argument": {
"type": "MemberExpression",
"span": {
"start": 827,
"end": 833,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 827,
"end": 831,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 832,
"end": 833,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "MethodProperty",
"key": {
"type": "Identifier",
"span": {
"start": 841,
"end": 843,
"ctxt": 0
},
"value": "m2",
"optional": false
},
"params": [],
"decorators": [],
"span": {
"start": 841,
"end": 884,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 846,
"end": 884,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 848,
"end": 868,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 848,
"end": 867,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 848,
"end": 854,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 848,
"end": 852,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 853,
"end": 854,
"ctxt": 0
},
"value": "z",
"optional": false
}
},
"right": {
"type": "BinaryExpression",
"span": {
"start": 857,
"end": 867,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "MemberExpression",
"span": {
"start": 857,
"end": 863,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 857,
"end": 861,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 862,
"end": 863,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 866,
"end": 867,
"ctxt": 0
},
"value": 1.0
}
}
}
},
{
"type": "ReturnStatement",
"span": {
"start": 869,
"end": 882,
"ctxt": 0
},
"argument": {
"type": "MemberExpression",
"span": {
"start": 876,
"end": 882,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 876,
"end": 880,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 881,
"end": 882,
"ctxt": 0
},
"value": "y",
"optional": false
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
]
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 887,
"end": 905,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 891,
"end": 905,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 891,
"end": 893,
"ctxt": 0
},
"value": "cp",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NewExpression",
"span": {
"start": 896,
"end": 905,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 900,
"end": 902,
"ctxt": 0
},
"value": "Cp",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 903,
"end": 904,
"ctxt": 0
},
"value": 1.0
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 929,
"end": 941,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 933,
"end": 941,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 933,
"end": 934,
"ctxt": 0
},
"value": "n",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 937,
"end": 941,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 937,
"end": 939,
"ctxt": 0
},
"value": "cp",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 940,
"end": 941,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 964,
"end": 976,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 968,
"end": 976,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 968,
"end": 969,
"ctxt": 0
},
"value": "n",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 972,
"end": 976,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 972,
"end": 974,
"ctxt": 0
},
"value": "cp",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 975,
"end": 976,
"ctxt": 0
},
"value": "y",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 999,
"end": 1014,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 1003,
"end": 1014,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1003,
"end": 1004,
"ctxt": 0
},
"value": "n",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 1007,
"end": 1014,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 1007,
"end": 1012,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 1007,
"end": 1009,
"ctxt": 0
},
"value": "cp",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 1010,
"end": 1012,
"ctxt": 0
},
"value": "m1",
"optional": false
}
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 1037,
"end": 1052,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 1041,
"end": 1052,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1041,
"end": 1042,
"ctxt": 0
},
"value": "n",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 1045,
"end": 1052,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 1045,
"end": 1050,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 1045,
"end": 1047,
"ctxt": 0
},
"value": "cp",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 1048,
"end": 1050,
"ctxt": 0
},
"value": "m2",
"optional": false
}
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
}
],
"interpreter": null
}