swc/crates/swc_ecma_parser/tests/tsc/for-of42.json

263 lines
6.7 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 15,
"end": 94,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 15,
"end": 44,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 19,
"end": 44,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 19,
"end": 24,
"ctxt": 0
},
"value": "array",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ArrayExpression",
"span": {
"start": 27,
"end": 44,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "ObjectExpression",
"span": {
"start": 28,
"end": 43,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 30,
"end": 31,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": {
"type": "StringLiteral",
"span": {
"start": 33,
"end": 35,
"ctxt": 0
},
"value": "",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
},
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 37,
"end": 38,
"ctxt": 0
},
"value": "y",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 40,
"end": 41,
"ctxt": 0
},
"value": 0.0
}
}
]
}
}
]
},
"definite": false
}
]
},
{
"type": "ForOfStatement",
"span": {
"start": 45,
"end": 94,
"ctxt": 0
},
"await": null,
"left": {
"type": "VariableDeclaration",
"span": {
"start": 50,
"end": 66,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 54,
"end": 66,
"ctxt": 0
},
"id": {
"type": "ObjectPattern",
"span": {
"start": 54,
"end": 66,
"ctxt": 0
},
"properties": [
{
"type": "KeyValuePatternProperty",
"key": {
"type": "Identifier",
"span": {
"start": 55,
"end": 56,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": {
"type": "Identifier",
"span": {
"start": 58,
"end": 59,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": null
}
},
{
"type": "KeyValuePatternProperty",
"key": {
"type": "Identifier",
"span": {
"start": 61,
"end": 62,
"ctxt": 0
},
"value": "y",
"optional": false
},
"value": {
"type": "Identifier",
"span": {
"start": 64,
"end": 65,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": null
}
}
],
"optional": false,
"typeAnnotation": null
},
"init": null,
"definite": false
}
]
},
"right": {
"type": "Identifier",
"span": {
"start": 70,
"end": 75,
"ctxt": 0
},
"value": "array",
"optional": false
},
"body": {
"type": "BlockStatement",
"span": {
"start": 77,
"end": 94,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 83,
"end": 85,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 83,
"end": 84,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 90,
"end": 92,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 90,
"end": 91,
"ctxt": 0
},
"value": "b",
"optional": false
}
}
]
}
}
],
"interpreter": null
}