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

1172 lines
26 KiB
JSON

{
"type": "Module",
"span": {
"start": 99,
"end": 903,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 99,
"end": 121,
"ctxt": 0
},
"declaration": {
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 115,
"end": 116,
"ctxt": 0
},
"value": "a",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 106,
"end": 121,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 119,
"end": 121,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
},
{
"type": "ExportDeclaration",
"span": {
"start": 123,
"end": 145,
"ctxt": 0
},
"declaration": {
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 139,
"end": 140,
"ctxt": 0
},
"value": "b",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 130,
"end": 145,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 143,
"end": 145,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 146,
"end": 160,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 146,
"end": 159,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 146,
"end": 151,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 146,
"end": 147,
"ctxt": 0
},
"value": "b",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 148,
"end": 151,
"ctxt": 0
},
"value": "cat",
"optional": false
}
},
"right": {
"type": "StringLiteral",
"span": {
"start": 154,
"end": 159,
"ctxt": 0
},
"value": "cat",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
},
{
"type": "ExportDeclaration",
"span": {
"start": 162,
"end": 184,
"ctxt": 0
},
"declaration": {
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 178,
"end": 179,
"ctxt": 0
},
"value": "c",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 169,
"end": 184,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 182,
"end": 184,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 185,
"end": 201,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 185,
"end": 201,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 185,
"end": 190,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 185,
"end": 186,
"ctxt": 0
},
"value": "c",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 187,
"end": 190,
"ctxt": 0
},
"value": "Cls",
"optional": false
}
},
"right": {
"type": "ClassExpression",
"identifier": null,
"span": {
"start": 193,
"end": 201,
"ctxt": 0
},
"decorators": [],
"body": [],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
}
}
},
{
"type": "ExportDeclaration",
"span": {
"start": 274,
"end": 332,
"ctxt": 0
},
"declaration": {
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 290,
"end": 291,
"ctxt": 0
},
"value": "d",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 292,
"end": 293,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 292,
"end": 293,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": null
}
},
{
"type": "Parameter",
"span": {
"start": 295,
"end": 296,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 295,
"end": 296,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 281,
"end": 332,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 298,
"end": 332,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 300,
"end": 330,
"ctxt": 0
},
"argument": {
"type": "ParenthesisExpression",
"span": {
"start": 323,
"end": 329,
"ctxt": 0
},
"expression": {
"type": "NullLiteral",
"span": {
"start": 324,
"end": 328,
"ctxt": 0
}
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
},
{
"type": "ExportDeclaration",
"span": {
"start": 411,
"end": 469,
"ctxt": 0
},
"declaration": {
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 427,
"end": 428,
"ctxt": 0
},
"value": "e",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 429,
"end": 430,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 429,
"end": 430,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": null
}
},
{
"type": "Parameter",
"span": {
"start": 432,
"end": 433,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 432,
"end": 433,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 418,
"end": 469,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 435,
"end": 469,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 437,
"end": 467,
"ctxt": 0
},
"argument": {
"type": "ParenthesisExpression",
"span": {
"start": 460,
"end": 466,
"ctxt": 0
},
"expression": {
"type": "NullLiteral",
"span": {
"start": 461,
"end": 465,
"ctxt": 0
}
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
},
{
"type": "ExportDeclaration",
"span": {
"start": 510,
"end": 548,
"ctxt": 0
},
"declaration": {
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 526,
"end": 527,
"ctxt": 0
},
"value": "f",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 528,
"end": 529,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 528,
"end": 529,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 517,
"end": 548,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 531,
"end": 548,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 537,
"end": 546,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 544,
"end": 545,
"ctxt": 0
},
"value": "a",
"optional": false
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 549,
"end": 560,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 549,
"end": 559,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 549,
"end": 555,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 549,
"end": 550,
"ctxt": 0
},
"value": "f",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 551,
"end": 555,
"ctxt": 0
},
"value": "self",
"optional": false
}
},
"right": {
"type": "Identifier",
"span": {
"start": 558,
"end": 559,
"ctxt": 0
},
"value": "f",
"optional": false
}
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 633,
"end": 634,
"ctxt": 0
},
"value": "g",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 635,
"end": 636,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 635,
"end": 636,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": null
}
},
{
"type": "Parameter",
"span": {
"start": 638,
"end": 639,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 638,
"end": 639,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 624,
"end": 669,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 641,
"end": 669,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 647,
"end": 667,
"ctxt": 0
},
"argument": {
"type": "BinaryExpression",
"span": {
"start": 654,
"end": 666,
"ctxt": 0
},
"operator": "&&",
"left": {
"type": "MemberExpression",
"span": {
"start": 654,
"end": 657,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 654,
"end": 655,
"ctxt": 0
},
"value": "a",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 656,
"end": 657,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
"right": {
"type": "CallExpression",
"span": {
"start": 661,
"end": 666,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 661,
"end": 664,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 661,
"end": 662,
"ctxt": 0
},
"value": "b",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 663,
"end": 664,
"ctxt": 0
},
"value": "y",
"optional": false
}
},
"arguments": [],
"typeArguments": null
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "ExportNamedDeclaration",
"span": {
"start": 671,
"end": 684,
"ctxt": 0
},
"specifiers": [
{
"type": "ExportSpecifier",
"span": {
"start": 680,
"end": 681,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 680,
"end": 681,
"ctxt": 0
},
"value": "g",
"optional": false
},
"exported": null,
"isTypeOnly": false
}
],
"source": null,
"typeOnly": false,
"asserts": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 757,
"end": 759,
"ctxt": 0
},
"value": "hh",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 760,
"end": 761,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 760,
"end": 761,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": null
}
},
{
"type": "Parameter",
"span": {
"start": 763,
"end": 764,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 763,
"end": 764,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 748,
"end": 794,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 766,
"end": 794,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 772,
"end": 792,
"ctxt": 0
},
"argument": {
"type": "BinaryExpression",
"span": {
"start": 779,
"end": 791,
"ctxt": 0
},
"operator": "&&",
"left": {
"type": "MemberExpression",
"span": {
"start": 779,
"end": 782,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 779,
"end": 780,
"ctxt": 0
},
"value": "a",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 781,
"end": 782,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
"right": {
"type": "CallExpression",
"span": {
"start": 786,
"end": 791,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 786,
"end": 789,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 786,
"end": 787,
"ctxt": 0
},
"value": "b",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 788,
"end": 789,
"ctxt": 0
},
"value": "y",
"optional": false
}
},
"arguments": [],
"typeArguments": null
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "ExportNamedDeclaration",
"span": {
"start": 796,
"end": 815,
"ctxt": 0
},
"specifiers": [
{
"type": "ExportSpecifier",
"span": {
"start": 805,
"end": 812,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 805,
"end": 807,
"ctxt": 0
},
"value": "hh",
"optional": false
},
"exported": {
"type": "Identifier",
"span": {
"start": 811,
"end": 812,
"ctxt": 0
},
"value": "h",
"optional": false
},
"isTypeOnly": false
}
],
"source": null,
"typeOnly": false,
"asserts": null
},
{
"type": "ExportDeclaration",
"span": {
"start": 817,
"end": 839,
"ctxt": 0
},
"declaration": {
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 833,
"end": 834,
"ctxt": 0
},
"value": "i",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 824,
"end": 839,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 837,
"end": 839,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
},
{
"type": "ExportNamedDeclaration",
"span": {
"start": 840,
"end": 859,
"ctxt": 0
},
"specifiers": [
{
"type": "ExportSpecifier",
"span": {
"start": 849,
"end": 856,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 849,
"end": 850,
"ctxt": 0
},
"value": "i",
"optional": false
},
"exported": {
"type": "Identifier",
"span": {
"start": 854,
"end": 856,
"ctxt": 0
},
"value": "ii",
"optional": false
},
"isTypeOnly": false
}
],
"source": null,
"typeOnly": false,
"asserts": null
},
{
"type": "ExportNamedDeclaration",
"span": {
"start": 861,
"end": 880,
"ctxt": 0
},
"specifiers": [
{
"type": "ExportSpecifier",
"span": {
"start": 870,
"end": 877,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 870,
"end": 871,
"ctxt": 0
},
"value": "j",
"optional": false
},
"exported": {
"type": "Identifier",
"span": {
"start": 875,
"end": 877,
"ctxt": 0
},
"value": "jj",
"optional": false
},
"isTypeOnly": false
}
],
"source": null,
"typeOnly": false,
"asserts": null
},
{
"type": "ExportDeclaration",
"span": {
"start": 881,
"end": 903,
"ctxt": 0
},
"declaration": {
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 897,
"end": 898,
"ctxt": 0
},
"value": "j",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 888,
"end": 903,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 901,
"end": 903,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
}
],
"interpreter": null
}