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

152 lines
3.4 KiB
JSON

{
"type": "Script",
"span": {
"start": 0,
"end": 49,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 0,
"end": 11,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 4,
"end": 10,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 4,
"end": 5,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 5,
"end": 10,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 7,
"end": 10,
"ctxt": 0
},
"kind": "any"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 12,
"end": 49,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 18,
"end": 48,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 18,
"end": 19,
"ctxt": 0
},
"value": "c",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ConditionalExpression",
"span": {
"start": 22,
"end": 48,
"ctxt": 0
},
"test": {
"type": "BooleanLiteral",
"span": {
"start": 22,
"end": 26,
"ctxt": 0
},
"value": true
},
"consequent": {
"type": "ParenthesisExpression",
"span": {
"start": 29,
"end": 32,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 30,
"end": 31,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
"alternate": {
"type": "FunctionExpression",
"identifier": null,
"params": [],
"decorators": [],
"span": {
"start": 35,
"end": 48,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 46,
"end": 48,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
},
"definite": false
}
]
}
],
"interpreter": null
}