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

390 lines
11 KiB
JSON

{
"type": "Script",
"span": {
"start": 16,
"end": 168,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 16,
"end": 102,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 20,
"end": 102,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 20,
"end": 25,
"ctxt": 0
},
"value": "array",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 25,
"end": 64,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsArrayType",
"span": {
"start": 27,
"end": 64,
"ctxt": 0
},
"elemType": {
"type": "TsTupleType",
"span": {
"start": 27,
"end": 62,
"ctxt": 0
},
"elemTypes": [
{
"type": "TsTupleElement",
"span": {
"start": 28,
"end": 34,
"ctxt": 0
},
"label": null,
"ty": {
"type": "TsKeywordType",
"span": {
"start": 28,
"end": 34,
"ctxt": 0
},
"kind": "number"
}
},
{
"type": "TsTupleElement",
"span": {
"start": 36,
"end": 61,
"ctxt": 0
},
"label": null,
"ty": {
"type": "TsUnionType",
"span": {
"start": 36,
"end": 61,
"ctxt": 0
},
"types": [
{
"type": "TsKeywordType",
"span": {
"start": 36,
"end": 42,
"ctxt": 0
},
"kind": "string"
},
{
"type": "TsKeywordType",
"span": {
"start": 45,
"end": 52,
"ctxt": 0
},
"kind": "boolean"
},
{
"type": "TsKeywordType",
"span": {
"start": 55,
"end": 61,
"ctxt": 0
},
"kind": "symbol"
}
]
}
}
]
}
}
}
},
"init": {
"type": "ArrayExpression",
"span": {
"start": 67,
"end": 102,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "ArrayExpression",
"span": {
"start": 68,
"end": 75,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 69,
"end": 70,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
},
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 72,
"end": 74,
"ctxt": 0
},
"value": "",
"raw": "\"\""
}
}
]
}
},
{
"spread": null,
"expression": {
"type": "ArrayExpression",
"span": {
"start": 77,
"end": 86,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 78,
"end": 79,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
},
{
"spread": null,
"expression": {
"type": "BooleanLiteral",
"span": {
"start": 81,
"end": 85,
"ctxt": 0
},
"value": true
}
}
]
}
},
{
"spread": null,
"expression": {
"type": "ArrayExpression",
"span": {
"start": 88,
"end": 101,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 89,
"end": 90,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
},
{
"spread": null,
"expression": {
"type": "CallExpression",
"span": {
"start": 92,
"end": 100,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 92,
"end": 98,
"ctxt": 0
},
"value": "Symbol",
"optional": false
},
"arguments": [],
"typeArguments": null
}
}
]
}
}
]
},
"definite": false
}
]
},
{
"type": "ForOfStatement",
"span": {
"start": 103,
"end": 168,
"ctxt": 0
},
"await": null,
"left": {
"type": "VariableDeclaration",
"span": {
"start": 108,
"end": 129,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 112,
"end": 129,
"ctxt": 0
},
"id": {
"type": "ArrayPattern",
"span": {
"start": 112,
"end": 129,
"ctxt": 0
},
"elements": [
{
"type": "Identifier",
"span": {
"start": 113,
"end": 116,
"ctxt": 0
},
"value": "num",
"optional": false,
"typeAnnotation": null
},
{
"type": "Identifier",
"span": {
"start": 118,
"end": 128,
"ctxt": 0
},
"value": "strBoolSym",
"optional": false,
"typeAnnotation": null
}
],
"optional": false,
"typeAnnotation": null
},
"init": null,
"definite": false
}
]
},
"right": {
"type": "Identifier",
"span": {
"start": 133,
"end": 138,
"ctxt": 0
},
"value": "array",
"optional": false
},
"body": {
"type": "BlockStatement",
"span": {
"start": 140,
"end": 168,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 146,
"end": 150,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 146,
"end": 149,
"ctxt": 0
},
"value": "num",
"optional": false
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 155,
"end": 166,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 155,
"end": 165,
"ctxt": 0
},
"value": "strBoolSym",
"optional": false
}
}
]
}
}
],
"interpreter": null
}