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

857 lines
28 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 14,
"end": 519,
"ctxt": 0
},
"body": [
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 14,
"end": 57,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 24,
"end": 30,
"ctxt": 0
},
"value": "IPoint",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 31,
"end": 57,
"ctxt": 0
},
"body": [
{
"type": "TsMethodSignature",
"span": {
"start": 37,
"end": 55,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 37,
"end": 44,
"ctxt": 0
},
"value": "getDist",
"optional": false
},
"computed": false,
"optional": false,
"params": [],
"typeAnn": {
"type": "TsTypeAnnotation",
"span": {
"start": 46,
"end": 54,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 48,
"end": 54,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": null
}
]
}
},
{
"type": "TsModuleDeclaration",
"span": {
"start": 69,
"end": 435,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 76,
"end": 82,
"ctxt": 0
},
"value": "Shapes",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 83,
"end": 435,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 103,
"end": 432,
"ctxt": 0
},
"declaration": {
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 116,
"end": 121,
"ctxt": 0
},
"value": "Point",
"optional": false
},
"declare": false,
"span": {
"start": 110,
"end": 432,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 151,
"end": 163,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 158,
"end": 161,
"ctxt": 0
},
"value": "con",
"optional": false
},
"value": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 161,
"end": 163,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 162,
"end": 163,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 162,
"end": 163,
"ctxt": 0
},
"value": "C",
"optional": false
},
"typeParams": null
}
},
"isStatic": false,
"decorators": [],
"accessibility": "public",
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
},
{
"type": "ClassProperty",
"span": {
"start": 164,
"end": 172,
"ctxt": 0
},
"key": {
"type": "StringLiteral",
"span": {
"start": 164,
"end": 171,
"ctxt": 0
},
"value": "hello",
"raw": "\"hello\""
},
"value": null,
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
},
{
"type": "Constructor",
"span": {
"start": 204,
"end": 256,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 204,
"end": 215,
"ctxt": 0
},
"value": "constructor",
"optional": false
},
"params": [
{
"type": "TsParameterProperty",
"span": {
"start": 217,
"end": 233,
"ctxt": 0
},
"decorators": [],
"accessibility": "public",
"override": false,
"readonly": false,
"param": {
"type": "Identifier",
"span": {
"start": 224,
"end": 233,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 225,
"end": 233,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 227,
"end": 233,
"ctxt": 0
},
"kind": "number"
}
}
}
},
{
"type": "TsParameterProperty",
"span": {
"start": 235,
"end": 251,
"ctxt": 0
},
"decorators": [],
"accessibility": "public",
"override": false,
"readonly": false,
"param": {
"type": "Identifier",
"span": {
"start": 242,
"end": 251,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 243,
"end": 251,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 245,
"end": 251,
"ctxt": 0
},
"kind": "number"
}
}
}
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 253,
"end": 256,
"ctxt": 0
},
"stmts": []
},
"accessibility": null,
"isOptional": false
},
{
"type": "ClassMethod",
"span": {
"start": 293,
"end": 359,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 293,
"end": 300,
"ctxt": 0
},
"value": "getDist",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 293,
"end": 359,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 303,
"end": 359,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 305,
"end": 357,
"ctxt": 0
},
"argument": {
"type": "CallExpression",
"span": {
"start": 312,
"end": 356,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 312,
"end": 321,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 312,
"end": 316,
"ctxt": 0
},
"value": "Math",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 317,
"end": 321,
"ctxt": 0
},
"value": "sqrt",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "BinaryExpression",
"span": {
"start": 322,
"end": 355,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "BinaryExpression",
"span": {
"start": 322,
"end": 337,
"ctxt": 0
},
"operator": "*",
"left": {
"type": "MemberExpression",
"span": {
"start": 322,
"end": 328,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 322,
"end": 326,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 327,
"end": 328,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
"right": {
"type": "MemberExpression",
"span": {
"start": 331,
"end": 337,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 331,
"end": 335,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 336,
"end": 337,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
},
"right": {
"type": "BinaryExpression",
"span": {
"start": 340,
"end": 355,
"ctxt": 0
},
"operator": "*",
"left": {
"type": "MemberExpression",
"span": {
"start": 340,
"end": 346,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 340,
"end": 344,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 345,
"end": 346,
"ctxt": 0
},
"value": "y",
"optional": false
}
},
"right": {
"type": "MemberExpression",
"span": {
"start": 349,
"end": 355,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 349,
"end": 353,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 354,
"end": 355,
"ctxt": 0
},
"value": "y",
"optional": false
}
}
}
}
}
],
"typeArguments": null
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassProperty",
"span": {
"start": 394,
"end": 426,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 401,
"end": 407,
"ctxt": 0
},
"value": "origin",
"optional": false
},
"value": {
"type": "NewExpression",
"span": {
"start": 410,
"end": 425,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 414,
"end": 419,
"ctxt": 0
},
"value": "Point",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 420,
"end": 421,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
},
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 423,
"end": 424,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
}
],
"typeArguments": null
},
"typeAnnotation": null,
"isStatic": true,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": [
{
"type": "TsExpressionWithTypeArguments",
"span": {
"start": 133,
"end": 139,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 133,
"end": 139,
"ctxt": 0
},
"value": "IPoint",
"optional": false
},
"typeArguments": null
}
]
}
}
]
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 456,
"end": 495,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 460,
"end": 494,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 460,
"end": 461,
"ctxt": 0
},
"value": "p",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 461,
"end": 469,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 463,
"end": 469,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 463,
"end": 469,
"ctxt": 0
},
"value": "IPoint",
"optional": false
},
"typeParams": null
}
}
},
"init": {
"type": "NewExpression",
"span": {
"start": 472,
"end": 494,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 476,
"end": 488,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 476,
"end": 482,
"ctxt": 0
},
"value": "Shapes",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 483,
"end": 488,
"ctxt": 0
},
"value": "Point",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 489,
"end": 490,
"ctxt": 0
},
"value": 3.0,
"raw": "3"
}
},
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 492,
"end": 493,
"ctxt": 0
},
"value": 4.0,
"raw": "4"
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 496,
"end": 519,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 500,
"end": 518,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 500,
"end": 504,
"ctxt": 0
},
"value": "dist",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 507,
"end": 518,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 507,
"end": 516,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 507,
"end": 508,
"ctxt": 0
},
"value": "p",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 509,
"end": 516,
"ctxt": 0
},
"value": "getDist",
"optional": false
}
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
}
],
"interpreter": null
}