swc/crates/swc_ecma_parser/tests/tsc/independentPropertyVariance.json
2022-03-22 07:54:08 +00:00

330 lines
9.3 KiB
JSON

{
"type": "Script",
"span": {
"start": 95,
"end": 182,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 95,
"end": 132,
"ctxt": 0
},
"kind": "const",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 109,
"end": 131,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 109,
"end": 110,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 110,
"end": 131,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 112,
"end": 131,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 114,
"end": 119,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 114,
"end": 115,
"ctxt": 0
},
"value": "a",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 115,
"end": 118,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsLiteralType",
"span": {
"start": 117,
"end": 118,
"ctxt": 0
},
"literal": {
"type": "NumericLiteral",
"span": {
"start": 117,
"end": 118,
"ctxt": 0
},
"value": 1.0
}
}
},
"typeParams": null
},
{
"type": "TsPropertySignature",
"span": {
"start": 120,
"end": 129,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 120,
"end": 121,
"ctxt": 0
},
"value": "b",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 121,
"end": 129,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 123,
"end": 129,
"ctxt": 0
},
"kind": "string"
}
},
"typeParams": null
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 133,
"end": 172,
"ctxt": 0
},
"kind": "const",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 147,
"end": 171,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 147,
"end": 148,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 148,
"end": 171,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 150,
"end": 171,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 152,
"end": 162,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 152,
"end": 153,
"ctxt": 0
},
"value": "a",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 153,
"end": 161,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 155,
"end": 161,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": null
},
{
"type": "TsPropertySignature",
"span": {
"start": 163,
"end": 169,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 163,
"end": 164,
"ctxt": 0
},
"value": "b",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 164,
"end": 169,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsLiteralType",
"span": {
"start": 166,
"end": 169,
"ctxt": 0
},
"literal": {
"type": "StringLiteral",
"span": {
"start": 166,
"end": 169,
"ctxt": 0
},
"value": "a",
"raw": "'a'"
}
}
},
"typeParams": null
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 174,
"end": 182,
"ctxt": 0
},
"expression": {
"type": "BinaryExpression",
"span": {
"start": 174,
"end": 181,
"ctxt": 0
},
"operator": "===",
"left": {
"type": "Identifier",
"span": {
"start": 174,
"end": 175,
"ctxt": 0
},
"value": "x",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
"start": 180,
"end": 181,
"ctxt": 0
},
"value": "y",
"optional": false
}
}
}
],
"interpreter": null
}