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

204 lines
5.6 KiB
JSON

{
"type": "Script",
"span": {
"start": 16,
"end": 101,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 16,
"end": 101,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 20,
"end": 101,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 20,
"end": 21,
"ctxt": 0
},
"value": "v",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ObjectExpression",
"span": {
"start": 24,
"end": 101,
"ctxt": 0
},
"properties": [
{
"type": "GetterProperty",
"span": {
"start": 30,
"end": 56,
"ctxt": 0
},
"key": {
"type": "Computed",
"span": {
"start": 34,
"end": 41,
"ctxt": 0
},
"expression": {
"type": "BinaryExpression",
"span": {
"start": 35,
"end": 40,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "NumericLiteral",
"span": {
"start": 35,
"end": 36,
"ctxt": 0
},
"value": 0.0
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 39,
"end": 40,
"ctxt": 0
},
"value": 1.0
}
}
},
"typeAnnotation": null,
"body": {
"type": "BlockStatement",
"span": {
"start": 44,
"end": 56,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 46,
"end": 54,
"ctxt": 0
},
"argument": {
"type": "NumericLiteral",
"span": {
"start": 53,
"end": 54,
"ctxt": 0
},
"value": 0.0
}
}
]
}
},
{
"type": "SetterProperty",
"span": {
"start": 62,
"end": 88,
"ctxt": 0
},
"key": {
"type": "Computed",
"span": {
"start": 66,
"end": 73,
"ctxt": 0
},
"expression": {
"type": "BinaryExpression",
"span": {
"start": 67,
"end": 72,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "NumericLiteral",
"span": {
"start": 67,
"end": 68,
"ctxt": 0
},
"value": 0.0
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 71,
"end": 72,
"ctxt": 0
},
"value": 1.0
}
}
},
"param": {
"type": "Identifier",
"span": {
"start": 74,
"end": 83,
"ctxt": 0
},
"value": "v",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 75,
"end": 83,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 77,
"end": 83,
"ctxt": 0
},
"kind": "string"
}
}
},
"body": {
"type": "BlockStatement",
"span": {
"start": 85,
"end": 88,
"ctxt": 0
},
"stmts": []
}
}
]
},
"definite": false
}
]
}
],
"interpreter": null
}