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

1101 lines
26 KiB
JSON

{
"type": "Script",
"span": {
"start": 96,
"end": 572,
"ctxt": 0
},
"body": [
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 105,
"end": 113,
"ctxt": 0
},
"value": "Instance",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 96,
"end": 141,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 116,
"end": 141,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 122,
"end": 139,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 122,
"end": 139,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 122,
"end": 128,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 122,
"end": 126,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 127,
"end": 128,
"ctxt": 0
},
"value": "i",
"optional": false
}
},
"right": {
"type": "StringLiteral",
"span": {
"start": 131,
"end": 139,
"ctxt": 0
},
"value": "simple",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "VariableDeclaration",
"span": {
"start": 142,
"end": 165,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 146,
"end": 164,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 146,
"end": 147,
"ctxt": 0
},
"value": "i",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NewExpression",
"span": {
"start": 150,
"end": 164,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 154,
"end": 162,
"ctxt": 0
},
"value": "Instance",
"optional": false
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 166,
"end": 175,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 166,
"end": 174,
"ctxt": 0
},
"value": "Instance",
"optional": false
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 176,
"end": 178,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 176,
"end": 177,
"ctxt": 0
},
"value": "i",
"optional": false
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 189,
"end": 198,
"ctxt": 0
},
"value": "StaticToo",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 180,
"end": 232,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 201,
"end": 232,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 207,
"end": 230,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 207,
"end": 230,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 207,
"end": 213,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 207,
"end": 211,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 212,
"end": 213,
"ctxt": 0
},
"value": "i",
"optional": false
}
},
"right": {
"type": "StringLiteral",
"span": {
"start": 216,
"end": 230,
"ctxt": 0
},
"value": "more complex",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "ExpressionStatement",
"span": {
"start": 233,
"end": 259,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 233,
"end": 259,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 233,
"end": 251,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 233,
"end": 242,
"ctxt": 0
},
"value": "StaticToo",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 243,
"end": 251,
"ctxt": 0
},
"value": "property",
"optional": false
}
},
"right": {
"type": "StringLiteral",
"span": {
"start": 254,
"end": 259,
"ctxt": 0
},
"value": "yep",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 260,
"end": 284,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 264,
"end": 283,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 264,
"end": 265,
"ctxt": 0
},
"value": "s",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NewExpression",
"span": {
"start": 268,
"end": 283,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 272,
"end": 281,
"ctxt": 0
},
"value": "StaticToo",
"optional": false
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 285,
"end": 287,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 285,
"end": 286,
"ctxt": 0
},
"value": "s",
"optional": false
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 288,
"end": 298,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 288,
"end": 297,
"ctxt": 0
},
"value": "StaticToo",
"optional": false
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 318,
"end": 319,
"ctxt": 0
},
"value": "A",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 309,
"end": 382,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 323,
"end": 382,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 329,
"end": 339,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 329,
"end": 339,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 329,
"end": 335,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 329,
"end": 333,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 334,
"end": 335,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 338,
"end": 339,
"ctxt": 0
},
"value": 1.0
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 365,
"end": 380,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 365,
"end": 380,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 365,
"end": 376,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 365,
"end": 369,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 370,
"end": 376,
"ctxt": 0
},
"value": "second",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 379,
"end": 380,
"ctxt": 0
},
"value": 1.0
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "ExpressionStatement",
"span": {
"start": 408,
"end": 463,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 408,
"end": 463,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 408,
"end": 421,
"ctxt": 0
},
"object": {
"type": "MemberExpression",
"span": {
"start": 408,
"end": 419,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 408,
"end": 409,
"ctxt": 0
},
"value": "A",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 410,
"end": 419,
"ctxt": 0
},
"value": "prototype",
"optional": false
}
},
"property": {
"type": "Identifier",
"span": {
"start": 420,
"end": 421,
"ctxt": 0
},
"value": "z",
"optional": false
}
},
"right": {
"type": "FunctionExpression",
"identifier": {
"type": "Identifier",
"span": {
"start": 433,
"end": 434,
"ctxt": 0
},
"value": "f",
"optional": false
},
"params": [
{
"type": "Parameter",
"span": {
"start": 435,
"end": 436,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 435,
"end": 436,
"ctxt": 0
},
"value": "n",
"optional": false,
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 424,
"end": 463,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 438,
"end": 463,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 444,
"end": 461,
"ctxt": 0
},
"argument": {
"type": "BinaryExpression",
"span": {
"start": 451,
"end": 461,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "Identifier",
"span": {
"start": 451,
"end": 452,
"ctxt": 0
},
"value": "n",
"optional": false
},
"right": {
"type": "MemberExpression",
"span": {
"start": 455,
"end": 461,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 455,
"end": 459,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 460,
"end": 461,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 489,
"end": 529,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 489,
"end": 529,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 489,
"end": 492,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 489,
"end": 490,
"ctxt": 0
},
"value": "A",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 491,
"end": 492,
"ctxt": 0
},
"value": "t",
"optional": false
}
},
"right": {
"type": "FunctionExpression",
"identifier": {
"type": "Identifier",
"span": {
"start": 504,
"end": 505,
"ctxt": 0
},
"value": "g",
"optional": false
},
"params": [
{
"type": "Parameter",
"span": {
"start": 506,
"end": 507,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 506,
"end": 507,
"ctxt": 0
},
"value": "m",
"optional": false,
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 495,
"end": 529,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 509,
"end": 529,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 515,
"end": 527,
"ctxt": 0
},
"argument": {
"type": "BinaryExpression",
"span": {
"start": 522,
"end": 527,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "Identifier",
"span": {
"start": 522,
"end": 523,
"ctxt": 0
},
"value": "m",
"optional": false
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 526,
"end": 527,
"ctxt": 0
},
"value": 1.0
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 530,
"end": 545,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 534,
"end": 545,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 534,
"end": 535,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NewExpression",
"span": {
"start": 538,
"end": 545,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 542,
"end": 543,
"ctxt": 0
},
"value": "A",
"optional": false
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 546,
"end": 552,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 546,
"end": 552,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 546,
"end": 549,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 546,
"end": 547,
"ctxt": 0
},
"value": "a",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 548,
"end": 549,
"ctxt": 0
},
"value": "z",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 550,
"end": 551,
"ctxt": 0
},
"value": 3.0
}
}
],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 553,
"end": 559,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 553,
"end": 559,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 553,
"end": 556,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 553,
"end": 554,
"ctxt": 0
},
"value": "A",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 555,
"end": 556,
"ctxt": 0
},
"value": "t",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 557,
"end": 558,
"ctxt": 0
},
"value": 2.0
}
}
],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 560,
"end": 572,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 560,
"end": 572,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 560,
"end": 568,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 560,
"end": 561,
"ctxt": 0
},
"value": "a",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 562,
"end": 568,
"ctxt": 0
},
"value": "second",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 571,
"end": 572,
"ctxt": 0
},
"value": 1.0
}
}
}
],
"interpreter": null
}