swc/crates/swc_ecma_parser/tests/tsc/objectRestCatchES5.json
2022-02-04 20:17:42 +09:00

173 lines
3.7 KiB
JSON

{
"type": "Script",
"span": {
"start": 0,
"end": 47,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 0,
"end": 17,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 4,
"end": 9,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 4,
"end": 5,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NumericLiteral",
"span": {
"start": 8,
"end": 9,
"ctxt": 0
},
"value": 1.0
},
"definite": false
},
{
"type": "VariableDeclarator",
"span": {
"start": 11,
"end": 16,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 11,
"end": 12,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NumericLiteral",
"span": {
"start": 15,
"end": 16,
"ctxt": 0
},
"value": 2.0
},
"definite": false
}
]
},
{
"type": "TryStatement",
"span": {
"start": 18,
"end": 47,
"ctxt": 0
},
"block": {
"type": "BlockStatement",
"span": {
"start": 22,
"end": 24,
"ctxt": 0
},
"stmts": []
},
"handler": {
"type": "CatchClause",
"span": {
"start": 25,
"end": 47,
"ctxt": 0
},
"param": {
"type": "ObjectPattern",
"span": {
"start": 32,
"end": 43,
"ctxt": 0
},
"properties": [
{
"type": "AssignmentPatternProperty",
"span": {
"start": 34,
"end": 35,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 34,
"end": 35,
"ctxt": 0
},
"value": "a",
"optional": false
},
"value": null
},
{
"type": "RestElement",
"span": {
"start": 37,
"end": 41,
"ctxt": 0
},
"rest": {
"start": 37,
"end": 40,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 40,
"end": 41,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": null
},
"typeAnnotation": null
}
],
"optional": false,
"typeAnnotation": null
},
"body": {
"type": "BlockStatement",
"span": {
"start": 45,
"end": 47,
"ctxt": 0
},
"stmts": []
}
},
"finalizer": null
}
],
"interpreter": null
}