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

304 lines
8.1 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 15,
"end": 106,
"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": 106,
"ctxt": 0
},
"await": null,
"left": {
"type": "VariableDeclaration",
"span": {
"start": 50,
"end": 78,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 54,
"end": 78,
"ctxt": 0
},
"id": {
"type": "ObjectPattern",
"span": {
"start": 54,
"end": 78,
"ctxt": 0
},
"properties": [
{
"type": "KeyValuePatternProperty",
"key": {
"type": "Identifier",
"span": {
"start": 55,
"end": 56,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": {
"type": "AssignmentPattern",
"span": {
"start": 58,
"end": 64,
"ctxt": 0
},
"left": {
"type": "Identifier",
"span": {
"start": 58,
"end": 59,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "StringLiteral",
"span": {
"start": 62,
"end": 64,
"ctxt": 0
},
"value": "",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
},
"typeAnnotation": null
}
},
{
"type": "KeyValuePatternProperty",
"key": {
"type": "Identifier",
"span": {
"start": 66,
"end": 67,
"ctxt": 0
},
"value": "y",
"optional": false
},
"value": {
"type": "AssignmentPattern",
"span": {
"start": 69,
"end": 77,
"ctxt": 0
},
"left": {
"type": "Identifier",
"span": {
"start": 69,
"end": 70,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "BooleanLiteral",
"span": {
"start": 73,
"end": 77,
"ctxt": 0
},
"value": true
},
"typeAnnotation": null
}
}
],
"optional": false,
"typeAnnotation": null
},
"init": null,
"definite": false
}
]
},
"right": {
"type": "Identifier",
"span": {
"start": 82,
"end": 87,
"ctxt": 0
},
"value": "array",
"optional": false
},
"body": {
"type": "BlockStatement",
"span": {
"start": 89,
"end": 106,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 95,
"end": 97,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 95,
"end": 96,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 102,
"end": 104,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 102,
"end": 103,
"ctxt": 0
},
"value": "b",
"optional": false
}
}
]
}
}
],
"interpreter": null
}