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

1168 lines
26 KiB
JSON

{
"type": "Module",
"span": {
"start": 100,
"end": 904,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 100,
"end": 122,
"ctxt": 0
},
"declaration": {
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 116,
"end": 117,
"ctxt": 0
},
"value": "a",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 107,
"end": 122,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 120,
"end": 122,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
},
{
"type": "ExportDeclaration",
"span": {
"start": 124,
"end": 146,
"ctxt": 0
},
"declaration": {
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 140,
"end": 141,
"ctxt": 0
},
"value": "b",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 131,
"end": 146,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 144,
"end": 146,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 147,
"end": 161,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 147,
"end": 160,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 147,
"end": 152,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 147,
"end": 148,
"ctxt": 0
},
"value": "b",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 149,
"end": 152,
"ctxt": 0
},
"value": "cat",
"optional": false
}
},
"right": {
"type": "StringLiteral",
"span": {
"start": 155,
"end": 160,
"ctxt": 0
},
"value": "cat",
"raw": "\"cat\""
}
}
},
{
"type": "ExportDeclaration",
"span": {
"start": 163,
"end": 185,
"ctxt": 0
},
"declaration": {
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 179,
"end": 180,
"ctxt": 0
},
"value": "c",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 170,
"end": 185,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 183,
"end": 185,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 186,
"end": 202,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 186,
"end": 202,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 186,
"end": 191,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 186,
"end": 187,
"ctxt": 0
},
"value": "c",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 188,
"end": 191,
"ctxt": 0
},
"value": "Cls",
"optional": false
}
},
"right": {
"type": "ClassExpression",
"identifier": null,
"span": {
"start": 194,
"end": 202,
"ctxt": 0
},
"decorators": [],
"body": [],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
}
}
},
{
"type": "ExportDeclaration",
"span": {
"start": 275,
"end": 333,
"ctxt": 0
},
"declaration": {
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 291,
"end": 292,
"ctxt": 0
},
"value": "d",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 293,
"end": 294,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 293,
"end": 294,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": null
}
},
{
"type": "Parameter",
"span": {
"start": 296,
"end": 297,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 296,
"end": 297,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 282,
"end": 333,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 299,
"end": 333,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 301,
"end": 331,
"ctxt": 0
},
"argument": {
"type": "ParenthesisExpression",
"span": {
"start": 324,
"end": 330,
"ctxt": 0
},
"expression": {
"type": "NullLiteral",
"span": {
"start": 325,
"end": 329,
"ctxt": 0
}
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
},
{
"type": "ExportDeclaration",
"span": {
"start": 412,
"end": 470,
"ctxt": 0
},
"declaration": {
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 428,
"end": 429,
"ctxt": 0
},
"value": "e",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 430,
"end": 431,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 430,
"end": 431,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": null
}
},
{
"type": "Parameter",
"span": {
"start": 433,
"end": 434,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 433,
"end": 434,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 419,
"end": 470,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 436,
"end": 470,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 438,
"end": 468,
"ctxt": 0
},
"argument": {
"type": "ParenthesisExpression",
"span": {
"start": 461,
"end": 467,
"ctxt": 0
},
"expression": {
"type": "NullLiteral",
"span": {
"start": 462,
"end": 466,
"ctxt": 0
}
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
},
{
"type": "ExportDeclaration",
"span": {
"start": 511,
"end": 549,
"ctxt": 0
},
"declaration": {
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 527,
"end": 528,
"ctxt": 0
},
"value": "f",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 529,
"end": 530,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 529,
"end": 530,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 518,
"end": 549,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 532,
"end": 549,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 538,
"end": 547,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 545,
"end": 546,
"ctxt": 0
},
"value": "a",
"optional": false
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 550,
"end": 561,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 550,
"end": 560,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 550,
"end": 556,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 550,
"end": 551,
"ctxt": 0
},
"value": "f",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 552,
"end": 556,
"ctxt": 0
},
"value": "self",
"optional": false
}
},
"right": {
"type": "Identifier",
"span": {
"start": 559,
"end": 560,
"ctxt": 0
},
"value": "f",
"optional": false
}
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 634,
"end": 635,
"ctxt": 0
},
"value": "g",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 636,
"end": 637,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 636,
"end": 637,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": null
}
},
{
"type": "Parameter",
"span": {
"start": 639,
"end": 640,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 639,
"end": 640,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 625,
"end": 670,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 642,
"end": 670,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 648,
"end": 668,
"ctxt": 0
},
"argument": {
"type": "BinaryExpression",
"span": {
"start": 655,
"end": 667,
"ctxt": 0
},
"operator": "&&",
"left": {
"type": "MemberExpression",
"span": {
"start": 655,
"end": 658,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 655,
"end": 656,
"ctxt": 0
},
"value": "a",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 657,
"end": 658,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
"right": {
"type": "CallExpression",
"span": {
"start": 662,
"end": 667,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 662,
"end": 665,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 662,
"end": 663,
"ctxt": 0
},
"value": "b",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 664,
"end": 665,
"ctxt": 0
},
"value": "y",
"optional": false
}
},
"arguments": [],
"typeArguments": null
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "ExportNamedDeclaration",
"span": {
"start": 672,
"end": 685,
"ctxt": 0
},
"specifiers": [
{
"type": "ExportSpecifier",
"span": {
"start": 681,
"end": 682,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 681,
"end": 682,
"ctxt": 0
},
"value": "g",
"optional": false
},
"exported": null,
"isTypeOnly": false
}
],
"source": null,
"typeOnly": false,
"asserts": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 758,
"end": 760,
"ctxt": 0
},
"value": "hh",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 761,
"end": 762,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 761,
"end": 762,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": null
}
},
{
"type": "Parameter",
"span": {
"start": 764,
"end": 765,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 764,
"end": 765,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 749,
"end": 795,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 767,
"end": 795,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 773,
"end": 793,
"ctxt": 0
},
"argument": {
"type": "BinaryExpression",
"span": {
"start": 780,
"end": 792,
"ctxt": 0
},
"operator": "&&",
"left": {
"type": "MemberExpression",
"span": {
"start": 780,
"end": 783,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 780,
"end": 781,
"ctxt": 0
},
"value": "a",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 782,
"end": 783,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
"right": {
"type": "CallExpression",
"span": {
"start": 787,
"end": 792,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 787,
"end": 790,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 787,
"end": 788,
"ctxt": 0
},
"value": "b",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 789,
"end": 790,
"ctxt": 0
},
"value": "y",
"optional": false
}
},
"arguments": [],
"typeArguments": null
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "ExportNamedDeclaration",
"span": {
"start": 797,
"end": 816,
"ctxt": 0
},
"specifiers": [
{
"type": "ExportSpecifier",
"span": {
"start": 806,
"end": 813,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 806,
"end": 808,
"ctxt": 0
},
"value": "hh",
"optional": false
},
"exported": {
"type": "Identifier",
"span": {
"start": 812,
"end": 813,
"ctxt": 0
},
"value": "h",
"optional": false
},
"isTypeOnly": false
}
],
"source": null,
"typeOnly": false,
"asserts": null
},
{
"type": "ExportDeclaration",
"span": {
"start": 818,
"end": 840,
"ctxt": 0
},
"declaration": {
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 834,
"end": 835,
"ctxt": 0
},
"value": "i",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 825,
"end": 840,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 838,
"end": 840,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
},
{
"type": "ExportNamedDeclaration",
"span": {
"start": 841,
"end": 860,
"ctxt": 0
},
"specifiers": [
{
"type": "ExportSpecifier",
"span": {
"start": 850,
"end": 857,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 850,
"end": 851,
"ctxt": 0
},
"value": "i",
"optional": false
},
"exported": {
"type": "Identifier",
"span": {
"start": 855,
"end": 857,
"ctxt": 0
},
"value": "ii",
"optional": false
},
"isTypeOnly": false
}
],
"source": null,
"typeOnly": false,
"asserts": null
},
{
"type": "ExportNamedDeclaration",
"span": {
"start": 862,
"end": 881,
"ctxt": 0
},
"specifiers": [
{
"type": "ExportSpecifier",
"span": {
"start": 871,
"end": 878,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 871,
"end": 872,
"ctxt": 0
},
"value": "j",
"optional": false
},
"exported": {
"type": "Identifier",
"span": {
"start": 876,
"end": 878,
"ctxt": 0
},
"value": "jj",
"optional": false
},
"isTypeOnly": false
}
],
"source": null,
"typeOnly": false,
"asserts": null
},
{
"type": "ExportDeclaration",
"span": {
"start": 882,
"end": 904,
"ctxt": 0
},
"declaration": {
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 898,
"end": 899,
"ctxt": 0
},
"value": "j",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 889,
"end": 904,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 902,
"end": 904,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
}
],
"interpreter": null
}