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

344 lines
10 KiB
JSON

{
"type": "Script",
"span": {
"start": 17,
"end": 442,
"ctxt": 0
},
"body": [
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 26,
"end": 27,
"ctxt": 0
},
"value": "f",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 17,
"end": 442,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 30,
"end": 442,
"ctxt": 0
},
"stmts": [
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 45,
"end": 46,
"ctxt": 0
},
"value": "g",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 36,
"end": 386,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 49,
"end": 386,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 59,
"end": 79,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 63,
"end": 78,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 63,
"end": 73,
"ctxt": 0
},
"value": "_arguments",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NumericLiteral",
"span": {
"start": 76,
"end": 78,
"ctxt": 0
},
"value": 10.0
},
"definite": false
}
]
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 150,
"end": 151,
"ctxt": 0
},
"value": "h",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 141,
"end": 380,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 154,
"end": 380,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 168,
"end": 198,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 172,
"end": 197,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 172,
"end": 179,
"ctxt": 0
},
"value": "capture",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ArrowFunctionExpression",
"span": {
"start": 182,
"end": 197,
"ctxt": 0
},
"params": [],
"body": {
"type": "Identifier",
"span": {
"start": 188,
"end": 197,
"ctxt": 0
},
"value": "arguments",
"optional": false
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 272,
"end": 288,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 272,
"end": 287,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 272,
"end": 275,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 276,
"end": 286,
"ctxt": 0
},
"value": "_arguments",
"optional": false
}
}
],
"typeArguments": null
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 401,
"end": 404,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 405,
"end": 411,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 405,
"end": 411,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 406,
"end": 411,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 408,
"end": 411,
"ctxt": 0
},
"kind": "any"
}
}
}
}
],
"decorators": [],
"span": {
"start": 392,
"end": 440,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 413,
"end": 440,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 423,
"end": 434,
"ctxt": 0
},
"argument": {
"type": "NumericLiteral",
"span": {
"start": 430,
"end": 433,
"ctxt": 0
},
"value": 100.0
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
],
"interpreter": null
}