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

892 lines
26 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 16,
"end": 450,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 16,
"end": 71,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 20,
"end": 71,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 20,
"end": 21,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ArrowFunctionExpression",
"span": {
"start": 24,
"end": 71,
"ctxt": 0
},
"params": [],
"body": {
"type": "BlockStatement",
"span": {
"start": 30,
"end": 71,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 36,
"end": 59,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 40,
"end": 58,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 40,
"end": 43,
"ctxt": 0
},
"value": "arg",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 46,
"end": 58,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 46,
"end": 55,
"ctxt": 0
},
"value": "arguments",
"optional": false
},
"property": {
"type": "Computed",
"span": {
"start": 55,
"end": 58,
"ctxt": 0
},
"expression": {
"type": "NumericLiteral",
"span": {
"start": 56,
"end": 57,
"ctxt": 0
},
"value": 0.0
}
}
},
"definite": false
}
]
}
]
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 73,
"end": 164,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 77,
"end": 164,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 77,
"end": 78,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "FunctionExpression",
"identifier": null,
"params": [],
"decorators": [],
"span": {
"start": 81,
"end": 164,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 93,
"end": 164,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 99,
"end": 162,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 103,
"end": 162,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 103,
"end": 104,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ArrowFunctionExpression",
"span": {
"start": 107,
"end": 162,
"ctxt": 0
},
"params": [],
"body": {
"type": "BlockStatement",
"span": {
"start": 113,
"end": 162,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 123,
"end": 146,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 127,
"end": 145,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 127,
"end": 130,
"ctxt": 0
},
"value": "arg",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 133,
"end": 145,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 133,
"end": 142,
"ctxt": 0
},
"value": "arguments",
"optional": false
},
"property": {
"type": "Computed",
"span": {
"start": 142,
"end": 145,
"ctxt": 0
},
"expression": {
"type": "NumericLiteral",
"span": {
"start": 143,
"end": 144,
"ctxt": 0
},
"value": 0.0
}
}
},
"definite": false
}
]
}
]
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
},
"definite": false
}
]
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"definite": false
}
]
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 175,
"end": 178,
"ctxt": 0
},
"value": "baz",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 166,
"end": 222,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 181,
"end": 222,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 184,
"end": 220,
"ctxt": 0
},
"expression": {
"type": "ArrowFunctionExpression",
"span": {
"start": 184,
"end": 220,
"ctxt": 0
},
"params": [],
"body": {
"type": "BlockStatement",
"span": {
"start": 190,
"end": 220,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 194,
"end": 217,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 198,
"end": 216,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 198,
"end": 201,
"ctxt": 0
},
"value": "arg",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 204,
"end": 216,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 204,
"end": 213,
"ctxt": 0
},
"value": "arguments",
"optional": false
},
"property": {
"type": "Computed",
"span": {
"start": 213,
"end": 216,
"ctxt": 0
},
"expression": {
"type": "NumericLiteral",
"span": {
"start": 214,
"end": 215,
"ctxt": 0
},
"value": 0.0
}
}
},
"definite": false
}
]
}
]
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 233,
"end": 236,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 237,
"end": 258,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 237,
"end": 258,
"ctxt": 0
},
"value": "inputFunc",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 246,
"end": 258,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsFunctionType",
"span": {
"start": 248,
"end": 258,
"ctxt": 0
},
"params": [],
"typeParams": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 251,
"end": 258,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 254,
"end": 258,
"ctxt": 0
},
"kind": "void"
}
}
}
}
}
}
],
"decorators": [],
"span": {
"start": 224,
"end": 263,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 260,
"end": 263,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "ExpressionStatement",
"span": {
"start": 264,
"end": 317,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 264,
"end": 316,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 264,
"end": 267,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "ArrowFunctionExpression",
"span": {
"start": 268,
"end": 315,
"ctxt": 0
},
"params": [],
"body": {
"type": "BlockStatement",
"span": {
"start": 274,
"end": 315,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 280,
"end": 303,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 284,
"end": 302,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 284,
"end": 287,
"ctxt": 0
},
"value": "arg",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 290,
"end": 302,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 290,
"end": 299,
"ctxt": 0
},
"value": "arguments",
"optional": false
},
"property": {
"type": "Computed",
"span": {
"start": 299,
"end": 302,
"ctxt": 0
},
"expression": {
"type": "NumericLiteral",
"span": {
"start": 300,
"end": 301,
"ctxt": 0
},
"value": 0.0
}
}
},
"definite": false
}
]
}
]
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
}
}
],
"typeArguments": null
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 328,
"end": 331,
"ctxt": 0
},
"value": "bar",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 319,
"end": 378,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 334,
"end": 378,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 340,
"end": 363,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 344,
"end": 362,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 344,
"end": 347,
"ctxt": 0
},
"value": "arg",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 350,
"end": 362,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 350,
"end": 359,
"ctxt": 0
},
"value": "arguments",
"optional": false
},
"property": {
"type": "Computed",
"span": {
"start": 359,
"end": 362,
"ctxt": 0
},
"expression": {
"type": "NumericLiteral",
"span": {
"start": 360,
"end": 361,
"ctxt": 0
},
"value": 0.0
}
}
},
"definite": false
}
]
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "ExpressionStatement",
"span": {
"start": 381,
"end": 450,
"ctxt": 0
},
"expression": {
"type": "ArrowFunctionExpression",
"span": {
"start": 381,
"end": 450,
"ctxt": 0
},
"params": [],
"body": {
"type": "BlockStatement",
"span": {
"start": 387,
"end": 450,
"ctxt": 0
},
"stmts": [
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 399,
"end": 402,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 390,
"end": 448,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 405,
"end": 448,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 409,
"end": 432,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 413,
"end": 431,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 413,
"end": 416,
"ctxt": 0
},
"value": "arg",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 419,
"end": 431,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 419,
"end": 428,
"ctxt": 0
},
"value": "arguments",
"optional": false
},
"property": {
"type": "Computed",
"span": {
"start": 428,
"end": 431,
"ctxt": 0
},
"expression": {
"type": "NumericLiteral",
"span": {
"start": 429,
"end": 430,
"ctxt": 0
},
"value": 0.0
}
}
},
"definite": false
}
]
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
]
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
}
}
],
"interpreter": null
}