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

137 lines
3.0 KiB
JSON

{
"type": "Script",
"span": {
"start": 0,
"end": 66,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 0,
"end": 25,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 4,
"end": 24,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 4,
"end": 5,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "AssignmentExpression",
"span": {
"start": 8,
"end": 24,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 8,
"end": 17,
"ctxt": 0
},
"value": "undefined",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "NullLiteral",
"span": {
"start": 20,
"end": 24,
"ctxt": 0
}
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 35,
"end": 66,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 39,
"end": 65,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 39,
"end": 40,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 40,
"end": 58,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeQuery",
"span": {
"start": 42,
"end": 58,
"ctxt": 0
},
"exprName": {
"type": "Identifier",
"span": {
"start": 49,
"end": 58,
"ctxt": 0
},
"value": "undefined",
"optional": false
}
}
}
},
"init": {
"type": "NullLiteral",
"span": {
"start": 61,
"end": 65,
"ctxt": 0
}
},
"definite": false
}
]
}
],
"interpreter": null
}