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

438 lines
10 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 1,
"end": 195,
"ctxt": 0
},
"body": [
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 1,
"end": 25,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 11,
"end": 12,
"ctxt": 0
},
"value": "A",
"optional": false
},
"declare": false,
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 12,
"end": 15,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 13,
"end": 14,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 13,
"end": 14,
"ctxt": 0
},
"value": "T",
"optional": false
},
"in": false,
"out": false,
"const": false,
"constraint": null,
"default": null
}
]
},
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 16,
"end": 25,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 18,
"end": 23,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 18,
"end": 19,
"ctxt": 0
},
"value": "x",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 19,
"end": 22,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 21,
"end": 22,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 21,
"end": 22,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
},
"typeParams": null
}
]
}
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 26,
"end": 52,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 36,
"end": 37,
"ctxt": 0
},
"value": "B",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 38,
"end": 52,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 40,
"end": 50,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 40,
"end": 41,
"ctxt": 0
},
"value": "m",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 41,
"end": 49,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 43,
"end": 49,
"ctxt": 0
},
"kind": "string"
}
},
"typeParams": null
}
]
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 147,
"end": 158,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 151,
"end": 157,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 151,
"end": 152,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 152,
"end": 157,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 154,
"end": 157,
"ctxt": 0
},
"kind": "any"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 159,
"end": 179,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 163,
"end": 178,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 163,
"end": 164,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "TsAsExpression",
"span": {
"start": 167,
"end": 178,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 167,
"end": 168,
"ctxt": 0
},
"value": "x",
"optional": false
},
"typeAnnotation": {
"type": "TsArrayType",
"span": {
"start": 172,
"end": 178,
"ctxt": 0
},
"elemType": {
"type": "TsTypeReference",
"span": {
"start": 172,
"end": 176,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 172,
"end": 173,
"ctxt": 0
},
"value": "A",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 173,
"end": 176,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 174,
"end": 175,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 174,
"end": 175,
"ctxt": 0
},
"value": "B",
"optional": false
},
"typeParams": null
}
]
}
}
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 180,
"end": 195,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 184,
"end": 194,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 184,
"end": 185,
"ctxt": 0
},
"value": "z",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 188,
"end": 194,
"ctxt": 0
},
"object": {
"type": "MemberExpression",
"span": {
"start": 188,
"end": 192,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 188,
"end": 189,
"ctxt": 0
},
"value": "y",
"optional": false
},
"property": {
"type": "Computed",
"span": {
"start": 189,
"end": 192,
"ctxt": 0
},
"expression": {
"type": "NumericLiteral",
"span": {
"start": 190,
"end": 191,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
}
},
"property": {
"type": "Identifier",
"span": {
"start": 193,
"end": 194,
"ctxt": 0
},
"value": "m",
"optional": false
}
},
"definite": false
}
]
}
],
"interpreter": null
}