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

288 lines
8.0 KiB
JSON

{
"type": "Script",
"span": {
"start": 18,
"end": 177,
"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": 177,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 31,
"end": 177,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 37,
"end": 80,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 41,
"end": 79,
"ctxt": 0
},
"id": {
"type": "ObjectPattern",
"span": {
"start": 41,
"end": 54,
"ctxt": 0
},
"properties": [
{
"type": "AssignmentPatternProperty",
"span": {
"start": 43,
"end": 52,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 43,
"end": 52,
"ctxt": 0
},
"value": "arguments",
"optional": false
},
"value": null
}
],
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ObjectExpression",
"span": {
"start": 57,
"end": 79,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 59,
"end": 68,
"ctxt": 0
},
"value": "arguments",
"optional": false
},
"value": {
"type": "StringLiteral",
"span": {
"start": 70,
"end": 77,
"ctxt": 0
},
"value": "hello",
"raw": "\"hello\""
}
}
]
},
"definite": false
}
]
},
{
"type": "IfStatement",
"span": {
"start": 85,
"end": 146,
"ctxt": 0
},
"test": {
"type": "CallExpression",
"span": {
"start": 89,
"end": 102,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 89,
"end": 100,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 89,
"end": 93,
"ctxt": 0
},
"value": "Math",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 94,
"end": 100,
"ctxt": 0
},
"value": "random",
"optional": false
}
},
"arguments": [],
"typeArguments": null
},
"consequent": {
"type": "BlockStatement",
"span": {
"start": 104,
"end": 146,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 114,
"end": 140,
"ctxt": 0
},
"argument": {
"type": "ArrowFunctionExpression",
"span": {
"start": 121,
"end": 139,
"ctxt": 0
},
"params": [],
"body": {
"type": "MemberExpression",
"span": {
"start": 127,
"end": 139,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 127,
"end": 136,
"ctxt": 0
},
"value": "arguments",
"optional": false
},
"property": {
"type": "Computed",
"span": {
"start": 136,
"end": 139,
"ctxt": 0
},
"expression": {
"type": "NumericLiteral",
"span": {
"start": 137,
"end": 138,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
}
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
}
}
]
},
"alternate": null
},
{
"type": "VariableDeclaration",
"span": {
"start": 151,
"end": 175,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 155,
"end": 174,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 155,
"end": 164,
"ctxt": 0
},
"value": "arguments",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "StringLiteral",
"span": {
"start": 167,
"end": 174,
"ctxt": 0
},
"value": "world",
"raw": "\"world\""
},
"definite": false
}
]
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
],
"interpreter": null
}