swc/crates/swc_ecma_parser/tests/tsc/for-of49.json
2022-03-22 07:54:08 +00:00

327 lines
7.9 KiB
JSON

{
"type": "Script",
"span": {
"start": 15,
"end": 117,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 15,
"end": 41,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 19,
"end": 28,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 19,
"end": 20,
"ctxt": 0
},
"value": "k",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 20,
"end": 28,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 22,
"end": 28,
"ctxt": 0
},
"kind": "string"
}
}
},
"init": null,
"definite": false
},
{
"type": "VariableDeclarator",
"span": {
"start": 30,
"end": 40,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 30,
"end": 31,
"ctxt": 0
},
"value": "v",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 31,
"end": 40,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 33,
"end": 40,
"ctxt": 0
},
"kind": "boolean"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 42,
"end": 74,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 46,
"end": 73,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 46,
"end": 49,
"ctxt": 0
},
"value": "map",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NewExpression",
"span": {
"start": 52,
"end": 73,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 56,
"end": 59,
"ctxt": 0
},
"value": "Map",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "ArrayExpression",
"span": {
"start": 60,
"end": 72,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "ArrayExpression",
"span": {
"start": 61,
"end": 71,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 62,
"end": 64,
"ctxt": 0
},
"value": "",
"raw": "\"\""
}
},
{
"spread": null,
"expression": {
"type": "BooleanLiteral",
"span": {
"start": 66,
"end": 70,
"ctxt": 0
},
"value": true
}
}
]
}
}
]
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "ForOfStatement",
"span": {
"start": 75,
"end": 117,
"ctxt": 0
},
"await": null,
"left": {
"type": "ArrayPattern",
"span": {
"start": 80,
"end": 91,
"ctxt": 0
},
"elements": [
{
"type": "Identifier",
"span": {
"start": 81,
"end": 82,
"ctxt": 0
},
"value": "k",
"optional": false,
"typeAnnotation": null
},
{
"type": "RestElement",
"span": {
"start": 87,
"end": 90,
"ctxt": 0
},
"rest": {
"start": 84,
"end": 87,
"ctxt": 0
},
"argument": {
"type": "ArrayPattern",
"span": {
"start": 87,
"end": 90,
"ctxt": 0
},
"elements": [
{
"type": "Identifier",
"span": {
"start": 88,
"end": 89,
"ctxt": 0
},
"value": "v",
"optional": false,
"typeAnnotation": null
}
],
"optional": false,
"typeAnnotation": null
},
"typeAnnotation": null
}
],
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 95,
"end": 98,
"ctxt": 0
},
"value": "map",
"optional": false
},
"body": {
"type": "BlockStatement",
"span": {
"start": 100,
"end": 117,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 106,
"end": 108,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 106,
"end": 107,
"ctxt": 0
},
"value": "k",
"optional": false
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 113,
"end": 115,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 113,
"end": 114,
"ctxt": 0
},
"value": "v",
"optional": false
}
}
]
}
}
],
"interpreter": null
}