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

212 lines
5.6 KiB
JSON

{
"type": "Script",
"span": {
"start": 18,
"end": 142,
"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": 142,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 31,
"end": 142,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 37,
"end": 77,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 41,
"end": 76,
"ctxt": 0
},
"id": {
"type": "ObjectPattern",
"span": {
"start": 41,
"end": 60,
"ctxt": 0
},
"properties": [
{
"type": "KeyValuePatternProperty",
"key": {
"type": "Identifier",
"span": {
"start": 43,
"end": 52,
"ctxt": 0
},
"value": "arguments",
"optional": false
},
"value": {
"type": "Identifier",
"span": {
"start": 54,
"end": 58,
"ctxt": 0
},
"value": "args",
"optional": false,
"typeAnnotation": null
}
}
],
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ObjectExpression",
"span": {
"start": 63,
"end": 76,
"ctxt": 0
},
"properties": [
{
"type": "Identifier",
"span": {
"start": 65,
"end": 74,
"ctxt": 0
},
"value": "arguments",
"optional": false
}
]
},
"definite": false
}
]
},
{
"type": "IfStatement",
"span": {
"start": 82,
"end": 140,
"ctxt": 0
},
"test": {
"type": "CallExpression",
"span": {
"start": 86,
"end": 99,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 86,
"end": 97,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 86,
"end": 90,
"ctxt": 0
},
"value": "Math",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 91,
"end": 97,
"ctxt": 0
},
"value": "random",
"optional": false
}
},
"arguments": [],
"typeArguments": null
},
"consequent": {
"type": "BlockStatement",
"span": {
"start": 101,
"end": 140,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 111,
"end": 134,
"ctxt": 0
},
"argument": {
"type": "ArrowFunctionExpression",
"span": {
"start": 118,
"end": 133,
"ctxt": 0
},
"params": [],
"body": {
"type": "Identifier",
"span": {
"start": 124,
"end": 133,
"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
}