swc/crates/swc_ecma_parser/tests/tsc/ES5For-of30.json
Donny/강동윤 3958f1792c
refactor(es/ast): Remove unused fields (#7518)
**Related issue:**

 - Closes #7347.
 - Closes #7487.
2023-06-12 08:02:34 +00:00

354 lines
8.3 KiB
JSON

{
"type": "Script",
"span": {
"start": 1,
"end": 115,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 1,
"end": 26,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 5,
"end": 14,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 5,
"end": 6,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 6,
"end": 14,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 8,
"end": 14,
"ctxt": 0
},
"kind": "string"
}
}
},
"init": null,
"definite": false
},
{
"type": "VariableDeclarator",
"span": {
"start": 16,
"end": 25,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 16,
"end": 17,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 17,
"end": 25,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 19,
"end": 25,
"ctxt": 0
},
"kind": "number"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 27,
"end": 66,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 31,
"end": 65,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 31,
"end": 36,
"ctxt": 0
},
"value": "tuple",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 36,
"end": 54,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTupleType",
"span": {
"start": 38,
"end": 54,
"ctxt": 0
},
"elemTypes": [
{
"type": "TsTupleElement",
"span": {
"start": 39,
"end": 45,
"ctxt": 0
},
"label": null,
"ty": {
"type": "TsKeywordType",
"span": {
"start": 39,
"end": 45,
"ctxt": 0
},
"kind": "number"
}
},
{
"type": "TsTupleElement",
"span": {
"start": 47,
"end": 53,
"ctxt": 0
},
"label": null,
"ty": {
"type": "TsKeywordType",
"span": {
"start": 47,
"end": 53,
"ctxt": 0
},
"kind": "string"
}
}
]
}
}
},
"init": {
"type": "ArrayExpression",
"span": {
"start": 57,
"end": 65,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 58,
"end": 59,
"ctxt": 0
},
"value": 2.0,
"raw": "2"
}
},
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 61,
"end": 64,
"ctxt": 0
},
"value": "3",
"raw": "\"3\""
}
}
]
},
"definite": false
}
]
},
{
"type": "ForOfStatement",
"span": {
"start": 67,
"end": 115,
"ctxt": 0
},
"await": false,
"left": {
"type": "ArrayPattern",
"span": {
"start": 72,
"end": 87,
"ctxt": 0
},
"elements": [
{
"type": "AssignmentPattern",
"span": {
"start": 73,
"end": 78,
"ctxt": 0
},
"left": {
"type": "Identifier",
"span": {
"start": 73,
"end": 74,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 77,
"end": 78,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
},
{
"type": "AssignmentPattern",
"span": {
"start": 80,
"end": 86,
"ctxt": 0
},
"left": {
"type": "Identifier",
"span": {
"start": 80,
"end": 81,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "StringLiteral",
"span": {
"start": 84,
"end": 86,
"ctxt": 0
},
"value": "",
"raw": "\"\""
}
}
],
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 91,
"end": 96,
"ctxt": 0
},
"value": "tuple",
"optional": false
},
"body": {
"type": "BlockStatement",
"span": {
"start": 98,
"end": 115,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 104,
"end": 106,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 104,
"end": 105,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 111,
"end": 113,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 111,
"end": 112,
"ctxt": 0
},
"value": "b",
"optional": false
}
}
]
}
}
],
"interpreter": null
}