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

612 lines
14 KiB
JSON

{
"type": "Script",
"span": {
"start": 0,
"end": 471,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 14,
"end": 28,
"ctxt": 0
},
"value": "StaticToString",
"optional": false
},
"declare": true,
"span": {
"start": 0,
"end": 61,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 35,
"end": 59,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 42,
"end": 50,
"ctxt": 0
},
"value": "toString",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 35,
"end": 59,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 52,
"end": 58,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 54,
"end": 58,
"ctxt": 0
},
"kind": "void"
}
}
},
"kind": "method",
"isStatic": true,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 72,
"end": 75,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 76,
"end": 106,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 76,
"end": 106,
"ctxt": 0
},
"value": "staticToString",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 90,
"end": 106,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 92,
"end": 106,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 92,
"end": 106,
"ctxt": 0
},
"value": "StaticToString",
"optional": false
},
"typeParams": null
}
}
}
}
],
"decorators": [],
"span": {
"start": 63,
"end": 164,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 108,
"end": 164,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 114,
"end": 162,
"ctxt": 0
},
"argument": {
"type": "BinaryExpression",
"span": {
"start": 121,
"end": 161,
"ctxt": 0
},
"operator": "instanceof",
"left": {
"type": "Identifier",
"span": {
"start": 121,
"end": 135,
"ctxt": 0
},
"value": "staticToString",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
"start": 147,
"end": 161,
"ctxt": 0
},
"value": "StaticToString",
"optional": false
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 180,
"end": 194,
"ctxt": 0
},
"value": "StaticToNumber",
"optional": false
},
"declare": true,
"span": {
"start": 166,
"end": 227,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 201,
"end": 225,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 208,
"end": 216,
"ctxt": 0
},
"value": "toNumber",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 201,
"end": 225,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 218,
"end": 224,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 220,
"end": 224,
"ctxt": 0
},
"kind": "void"
}
}
},
"kind": "method",
"isStatic": true,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 237,
"end": 240,
"ctxt": 0
},
"value": "bar",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 241,
"end": 271,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 241,
"end": 271,
"ctxt": 0
},
"value": "staticToNumber",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 255,
"end": 271,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 257,
"end": 271,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 257,
"end": 271,
"ctxt": 0
},
"value": "StaticToNumber",
"optional": false
},
"typeParams": null
}
}
}
}
],
"decorators": [],
"span": {
"start": 228,
"end": 329,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 273,
"end": 329,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 279,
"end": 327,
"ctxt": 0
},
"argument": {
"type": "BinaryExpression",
"span": {
"start": 286,
"end": 326,
"ctxt": 0
},
"operator": "instanceof",
"left": {
"type": "Identifier",
"span": {
"start": 286,
"end": 300,
"ctxt": 0
},
"value": "staticToNumber",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
"start": 312,
"end": 326,
"ctxt": 0
},
"value": "StaticToNumber",
"optional": false
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 345,
"end": 359,
"ctxt": 0
},
"value": "NormalToString",
"optional": false
},
"declare": true,
"span": {
"start": 331,
"end": 385,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 366,
"end": 383,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 366,
"end": 374,
"ctxt": 0
},
"value": "toString",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 366,
"end": 383,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 376,
"end": 382,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 378,
"end": 382,
"ctxt": 0
},
"kind": "void"
}
}
},
"kind": "method",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 395,
"end": 398,
"ctxt": 0
},
"value": "baz",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 399,
"end": 421,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 399,
"end": 421,
"ctxt": 0
},
"value": "normal",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 405,
"end": 421,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 407,
"end": 421,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 407,
"end": 421,
"ctxt": 0
},
"value": "NormalToString",
"optional": false
},
"typeParams": null
}
}
}
}
],
"decorators": [],
"span": {
"start": 386,
"end": 471,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 423,
"end": 471,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 429,
"end": 469,
"ctxt": 0
},
"argument": {
"type": "BinaryExpression",
"span": {
"start": 436,
"end": 468,
"ctxt": 0
},
"operator": "instanceof",
"left": {
"type": "Identifier",
"span": {
"start": 436,
"end": 442,
"ctxt": 0
},
"value": "normal",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
"start": 454,
"end": 468,
"ctxt": 0
},
"value": "NormalToString",
"optional": false
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
],
"interpreter": null
}