mirror of
https://github.com/swc-project/swc.git
synced 2024-11-24 10:12:42 +03:00
3958f1792c
**Related issue:** - Closes #7347. - Closes #7487.
258 lines
5.9 KiB
JSON
258 lines
5.9 KiB
JSON
{
|
|
"type": "Script",
|
|
"span": {
|
|
"start": 1,
|
|
"end": 80,
|
|
"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": "ForOfStatement",
|
|
"span": {
|
|
"start": 28,
|
|
"end": 80,
|
|
"ctxt": 0
|
|
},
|
|
"await": false,
|
|
"left": {
|
|
"type": "ObjectPattern",
|
|
"span": {
|
|
"start": 33,
|
|
"end": 55,
|
|
"ctxt": 0
|
|
},
|
|
"properties": [
|
|
{
|
|
"type": "KeyValuePatternProperty",
|
|
"key": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 35,
|
|
"end": 36,
|
|
"ctxt": 0
|
|
},
|
|
"value": "a",
|
|
"optional": false
|
|
},
|
|
"value": {
|
|
"type": "AssignmentPattern",
|
|
"span": {
|
|
"start": 38,
|
|
"end": 43,
|
|
"ctxt": 0
|
|
},
|
|
"left": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 38,
|
|
"end": 39,
|
|
"ctxt": 0
|
|
},
|
|
"value": "b",
|
|
"optional": false,
|
|
"typeAnnotation": null
|
|
},
|
|
"right": {
|
|
"type": "NumericLiteral",
|
|
"span": {
|
|
"start": 42,
|
|
"end": 43,
|
|
"ctxt": 0
|
|
},
|
|
"value": 1.0,
|
|
"raw": "1"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"type": "KeyValuePatternProperty",
|
|
"key": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 45,
|
|
"end": 46,
|
|
"ctxt": 0
|
|
},
|
|
"value": "b",
|
|
"optional": false
|
|
},
|
|
"value": {
|
|
"type": "AssignmentPattern",
|
|
"span": {
|
|
"start": 48,
|
|
"end": 54,
|
|
"ctxt": 0
|
|
},
|
|
"left": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 48,
|
|
"end": 49,
|
|
"ctxt": 0
|
|
},
|
|
"value": "a",
|
|
"optional": false,
|
|
"typeAnnotation": null
|
|
},
|
|
"right": {
|
|
"type": "StringLiteral",
|
|
"span": {
|
|
"start": 52,
|
|
"end": 54,
|
|
"ctxt": 0
|
|
},
|
|
"value": "",
|
|
"raw": "\"\""
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"optional": false,
|
|
"typeAnnotation": null
|
|
},
|
|
"right": {
|
|
"type": "ArrayExpression",
|
|
"span": {
|
|
"start": 59,
|
|
"end": 61,
|
|
"ctxt": 0
|
|
},
|
|
"elements": []
|
|
},
|
|
"body": {
|
|
"type": "BlockStatement",
|
|
"span": {
|
|
"start": 63,
|
|
"end": 80,
|
|
"ctxt": 0
|
|
},
|
|
"stmts": [
|
|
{
|
|
"type": "ExpressionStatement",
|
|
"span": {
|
|
"start": 69,
|
|
"end": 71,
|
|
"ctxt": 0
|
|
},
|
|
"expression": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 69,
|
|
"end": 70,
|
|
"ctxt": 0
|
|
},
|
|
"value": "a",
|
|
"optional": false
|
|
}
|
|
},
|
|
{
|
|
"type": "ExpressionStatement",
|
|
"span": {
|
|
"start": 76,
|
|
"end": 78,
|
|
"ctxt": 0
|
|
},
|
|
"expression": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 76,
|
|
"end": 77,
|
|
"ctxt": 0
|
|
},
|
|
"value": "b",
|
|
"optional": false
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
],
|
|
"interpreter": null
|
|
}
|