swc/crates/swc_ecma_parser/tests/tsc/ES5For-of34.json

275 lines
6.5 KiB
JSON

{
"type": "Script",
"span": {
"start": 47,
"end": 144,
"ctxt": 0
},
"body": [
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 56,
"end": 59,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 47,
"end": 86,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 62,
"end": 86,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 68,
"end": 84,
"ctxt": 0
},
"argument": {
"type": "ObjectExpression",
"span": {
"start": 75,
"end": 83,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 77,
"end": 78,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 80,
"end": 81,
"ctxt": 0
},
"value": 0.0
}
}
]
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "ForOfStatement",
"span": {
"start": 87,
"end": 144,
"ctxt": 0
},
"await": null,
"left": {
"type": "MemberExpression",
"span": {
"start": 92,
"end": 99,
"ctxt": 0
},
"object": {
"type": "CallExpression",
"span": {
"start": 92,
"end": 97,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 92,
"end": 95,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"arguments": [],
"typeArguments": null
},
"property": {
"type": "Identifier",
"span": {
"start": 98,
"end": 99,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
"right": {
"type": "ArrayExpression",
"span": {
"start": 103,
"end": 118,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 104,
"end": 107,
"ctxt": 0
},
"value": "a",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
},
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 109,
"end": 112,
"ctxt": 0
},
"value": "b",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
},
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 114,
"end": 117,
"ctxt": 0
},
"value": "c",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
]
},
"body": {
"type": "BlockStatement",
"span": {
"start": 120,
"end": 144,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 126,
"end": 142,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 130,
"end": 141,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 130,
"end": 131,
"ctxt": 0
},
"value": "p",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 134,
"end": 141,
"ctxt": 0
},
"object": {
"type": "CallExpression",
"span": {
"start": 134,
"end": 139,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 134,
"end": 137,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"arguments": [],
"typeArguments": null
},
"property": {
"type": "Identifier",
"span": {
"start": 140,
"end": 141,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
"definite": false
}
]
}
]
}
}
],
"interpreter": null
}