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

138 lines
3.0 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 1,
"end": 67,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 1,
"end": 26,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 5,
"end": 25,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 5,
"end": 6,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "AssignmentExpression",
"span": {
"start": 9,
"end": 25,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 9,
"end": 18,
"ctxt": 0
},
"value": "undefined",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "NullLiteral",
"span": {
"start": 21,
"end": 25,
"ctxt": 0
}
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 36,
"end": 67,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 40,
"end": 66,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 40,
"end": 41,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 41,
"end": 59,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeQuery",
"span": {
"start": 43,
"end": 59,
"ctxt": 0
},
"exprName": {
"type": "Identifier",
"span": {
"start": 50,
"end": 59,
"ctxt": 0
},
"value": "undefined",
"optional": false
},
"typeArguments": null
}
}
},
"init": {
"type": "NullLiteral",
"span": {
"start": 62,
"end": 66,
"ctxt": 0
}
},
"definite": false
}
]
}
],
"interpreter": null
}