swc/crates/swc_ecma_parser/tests/tsc/objectRestCatchES5.json

173 lines
3.7 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 0,
"end": 48,
"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": 19,
"end": 48,
"ctxt": 0
},
"block": {
"type": "BlockStatement",
"span": {
"start": 23,
"end": 25,
"ctxt": 0
},
"stmts": []
},
"handler": {
"type": "CatchClause",
"span": {
"start": 26,
"end": 48,
"ctxt": 0
},
"param": {
"type": "ObjectPattern",
"span": {
"start": 33,
"end": 44,
"ctxt": 0
},
"properties": [
{
"type": "AssignmentPatternProperty",
"span": {
"start": 35,
"end": 36,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 35,
"end": 36,
"ctxt": 0
},
"value": "a",
"optional": false
},
"value": null
},
{
"type": "RestElement",
"span": {
"start": 38,
"end": 42,
"ctxt": 0
},
"rest": {
"start": 38,
"end": 41,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 41,
"end": 42,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": null
},
"typeAnnotation": null
}
],
"optional": false,
"typeAnnotation": null
},
"body": {
"type": "BlockStatement",
"span": {
"start": 46,
"end": 48,
"ctxt": 0
},
"stmts": []
}
},
"finalizer": null
}
],
"interpreter": null
}