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

188 lines
3.9 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 0,
"end": 42,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 0,
"end": 10,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 4,
"end": 9,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 4,
"end": 5,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NumericLiteral",
"span": {
"start": 8,
"end": 9,
"ctxt": 0
},
"value": 1.0
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 12,
"end": 26,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 16,
"end": 25,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 16,
"end": 17,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 17,
"end": 25,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 19,
"end": 25,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 19,
"end": 25,
"ctxt": 0
},
"value": "Number",
"optional": false
},
"typeParams": null
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 28,
"end": 34,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 28,
"end": 33,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 28,
"end": 29,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 32,
"end": 33,
"ctxt": 0
},
"value": "a",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 36,
"end": 42,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 36,
"end": 41,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 36,
"end": 37,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 40,
"end": 41,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
}
],
"interpreter": null
}