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

264 lines
6.2 KiB
JSON

{
"type": "Script",
"span": {
"start": 48,
"end": 145,
"ctxt": 0
},
"body": [
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 57,
"end": 60,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 48,
"end": 87,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 63,
"end": 87,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 69,
"end": 85,
"ctxt": 0
},
"argument": {
"type": "ObjectExpression",
"span": {
"start": 76,
"end": 84,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 78,
"end": 79,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 81,
"end": 82,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
}
]
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "ForOfStatement",
"span": {
"start": 88,
"end": 145,
"ctxt": 0
},
"await": false,
"left": {
"type": "MemberExpression",
"span": {
"start": 93,
"end": 100,
"ctxt": 0
},
"object": {
"type": "CallExpression",
"span": {
"start": 93,
"end": 98,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 93,
"end": 96,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"arguments": [],
"typeArguments": null
},
"property": {
"type": "Identifier",
"span": {
"start": 99,
"end": 100,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
"right": {
"type": "ArrayExpression",
"span": {
"start": 104,
"end": 119,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 105,
"end": 108,
"ctxt": 0
},
"value": "a",
"raw": "'a'"
}
},
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 110,
"end": 113,
"ctxt": 0
},
"value": "b",
"raw": "'b'"
}
},
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 115,
"end": 118,
"ctxt": 0
},
"value": "c",
"raw": "'c'"
}
}
]
},
"body": {
"type": "BlockStatement",
"span": {
"start": 121,
"end": 145,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 127,
"end": 143,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 131,
"end": 142,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 131,
"end": 132,
"ctxt": 0
},
"value": "p",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 135,
"end": 142,
"ctxt": 0
},
"object": {
"type": "CallExpression",
"span": {
"start": 135,
"end": 140,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 135,
"end": 138,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"arguments": [],
"typeArguments": null
},
"property": {
"type": "Identifier",
"span": {
"start": 141,
"end": 142,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
"definite": false
}
]
}
]
}
}
],
"interpreter": null
}