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

279 lines
6.8 KiB
JSON

{
"type": "Script",
"span": {
"start": 0,
"end": 112,
"ctxt": 0
},
"body": [
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 9,
"end": 12,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 0,
"end": 39,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 15,
"end": 39,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 21,
"end": 37,
"ctxt": 0
},
"argument": {
"type": "ObjectExpression",
"span": {
"start": 28,
"end": 36,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 30,
"end": 31,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 33,
"end": 34,
"ctxt": 0
},
"value": 0.0
}
}
]
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "ForOfStatement",
"span": {
"start": 40,
"end": 112,
"ctxt": 0
},
"await": null,
"left": {
"type": "MemberExpression",
"span": {
"start": 45,
"end": 52,
"ctxt": 0
},
"object": {
"type": "CallExpression",
"span": {
"start": 45,
"end": 50,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 45,
"end": 48,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"arguments": [],
"typeArguments": null
},
"property": {
"type": "Identifier",
"span": {
"start": 51,
"end": 52,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
"right": {
"type": "ArrayExpression",
"span": {
"start": 56,
"end": 58,
"ctxt": 0
},
"elements": []
},
"body": {
"type": "BlockStatement",
"span": {
"start": 60,
"end": 112,
"ctxt": 0
},
"stmts": [
{
"type": "ForOfStatement",
"span": {
"start": 66,
"end": 110,
"ctxt": 0
},
"await": null,
"left": {
"type": "MemberExpression",
"span": {
"start": 71,
"end": 78,
"ctxt": 0
},
"object": {
"type": "CallExpression",
"span": {
"start": 71,
"end": 76,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 71,
"end": 74,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"arguments": [],
"typeArguments": null
},
"property": {
"type": "Identifier",
"span": {
"start": 77,
"end": 78,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
"right": {
"type": "ArrayExpression",
"span": {
"start": 82,
"end": 84,
"ctxt": 0
},
"elements": []
},
"body": {
"type": "VariableDeclaration",
"span": {
"start": 94,
"end": 110,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 98,
"end": 109,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 98,
"end": 99,
"ctxt": 0
},
"value": "p",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 102,
"end": 109,
"ctxt": 0
},
"object": {
"type": "CallExpression",
"span": {
"start": 102,
"end": 107,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 102,
"end": 105,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"arguments": [],
"typeArguments": null
},
"property": {
"type": "Identifier",
"span": {
"start": 108,
"end": 109,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
"definite": false
}
]
}
}
]
}
}
],
"interpreter": null
}