swc/crates/swc_ecma_parser/tests/tsc/ES5For-of10.json
2023-03-12 04:50:28 +00:00

280 lines
6.9 KiB
JSON

{
"type": "Script",
"span": {
"start": 1,
"end": 113,
"ctxt": 0
},
"body": [
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 10,
"end": 13,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 1,
"end": 40,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 16,
"end": 40,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 22,
"end": 38,
"ctxt": 0
},
"argument": {
"type": "ObjectExpression",
"span": {
"start": 29,
"end": 37,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 31,
"end": 32,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 34,
"end": 35,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
}
]
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "ForOfStatement",
"span": {
"start": 41,
"end": 113,
"ctxt": 0
},
"await": false,
"left": {
"type": "MemberExpression",
"span": {
"start": 46,
"end": 53,
"ctxt": 0
},
"object": {
"type": "CallExpression",
"span": {
"start": 46,
"end": 51,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 46,
"end": 49,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"arguments": [],
"typeArguments": null
},
"property": {
"type": "Identifier",
"span": {
"start": 52,
"end": 53,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
"right": {
"type": "ArrayExpression",
"span": {
"start": 57,
"end": 59,
"ctxt": 0
},
"elements": []
},
"body": {
"type": "BlockStatement",
"span": {
"start": 61,
"end": 113,
"ctxt": 0
},
"stmts": [
{
"type": "ForOfStatement",
"span": {
"start": 67,
"end": 111,
"ctxt": 0
},
"await": false,
"left": {
"type": "MemberExpression",
"span": {
"start": 72,
"end": 79,
"ctxt": 0
},
"object": {
"type": "CallExpression",
"span": {
"start": 72,
"end": 77,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 72,
"end": 75,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"arguments": [],
"typeArguments": null
},
"property": {
"type": "Identifier",
"span": {
"start": 78,
"end": 79,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
"right": {
"type": "ArrayExpression",
"span": {
"start": 83,
"end": 85,
"ctxt": 0
},
"elements": []
},
"body": {
"type": "VariableDeclaration",
"span": {
"start": 95,
"end": 111,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 99,
"end": 110,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 99,
"end": 100,
"ctxt": 0
},
"value": "p",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 103,
"end": 110,
"ctxt": 0
},
"object": {
"type": "CallExpression",
"span": {
"start": 103,
"end": 108,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 103,
"end": 106,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"arguments": [],
"typeArguments": null
},
"property": {
"type": "Identifier",
"span": {
"start": 109,
"end": 110,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
"definite": false
}
]
}
}
]
}
}
],
"interpreter": null
}