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

219 lines
5.8 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 18,
"end": 157,
"ctxt": 0
},
"body": [
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 27,
"end": 28,
"ctxt": 0
},
"value": "f",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 18,
"end": 157,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 31,
"end": 157,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 37,
"end": 61,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 41,
"end": 60,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 41,
"end": 50,
"ctxt": 0
},
"value": "arguments",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "StringLiteral",
"span": {
"start": 53,
"end": 60,
"ctxt": 0
},
"value": "hello",
"raw": "\"hello\""
},
"definite": false
}
]
},
{
"type": "IfStatement",
"span": {
"start": 66,
"end": 155,
"ctxt": 0
},
"test": {
"type": "CallExpression",
"span": {
"start": 70,
"end": 83,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 70,
"end": 81,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 70,
"end": 74,
"ctxt": 0
},
"value": "Math",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 75,
"end": 81,
"ctxt": 0
},
"value": "random",
"optional": false
}
},
"arguments": [],
"typeArguments": null
},
"consequent": {
"type": "BlockStatement",
"span": {
"start": 85,
"end": 155,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 95,
"end": 117,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 101,
"end": 116,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 101,
"end": 110,
"ctxt": 0
},
"value": "arguments",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NumericLiteral",
"span": {
"start": 113,
"end": 116,
"ctxt": 0
},
"value": 100.0,
"raw": "100"
},
"definite": false
}
]
},
{
"type": "ReturnStatement",
"span": {
"start": 126,
"end": 149,
"ctxt": 0
},
"argument": {
"type": "ArrowFunctionExpression",
"span": {
"start": 133,
"end": 148,
"ctxt": 0
},
"params": [],
"body": {
"type": "Identifier",
"span": {
"start": 139,
"end": 148,
"ctxt": 0
},
"value": "arguments",
"optional": false
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
}
}
]
},
"alternate": null
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
],
"interpreter": null
}