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

109 lines
2.3 KiB
JSON

{
"type": "Script",
"span": {
"start": 1,
"end": 40,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 1,
"end": 25,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 5,
"end": 24,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 5,
"end": 6,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 6,
"end": 24,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeQuery",
"span": {
"start": 8,
"end": 24,
"ctxt": 0
},
"exprName": {
"type": "Identifier",
"span": {
"start": 15,
"end": 24,
"ctxt": 0
},
"value": "undefined",
"optional": false
},
"typeArguments": null
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 26,
"end": 40,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 26,
"end": 39,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 26,
"end": 27,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 30,
"end": 39,
"ctxt": 0
},
"value": "undefined",
"optional": false
}
}
}
],
"interpreter": null
}