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

1095 lines
25 KiB
JSON

{
"type": "Script",
"span": {
"start": 97,
"end": 573,
"ctxt": 0
},
"body": [
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 106,
"end": 114,
"ctxt": 0
},
"value": "Instance",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 97,
"end": 142,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 117,
"end": 142,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 123,
"end": 140,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 123,
"end": 140,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 123,
"end": 129,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 123,
"end": 127,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 128,
"end": 129,
"ctxt": 0
},
"value": "i",
"optional": false
}
},
"right": {
"type": "StringLiteral",
"span": {
"start": 132,
"end": 140,
"ctxt": 0
},
"value": "simple",
"raw": "'simple'"
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "VariableDeclaration",
"span": {
"start": 143,
"end": 166,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 147,
"end": 165,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 147,
"end": 148,
"ctxt": 0
},
"value": "i",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NewExpression",
"span": {
"start": 151,
"end": 165,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 155,
"end": 163,
"ctxt": 0
},
"value": "Instance",
"optional": false
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 167,
"end": 176,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 167,
"end": 175,
"ctxt": 0
},
"value": "Instance",
"optional": false
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 177,
"end": 179,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 177,
"end": 178,
"ctxt": 0
},
"value": "i",
"optional": false
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 190,
"end": 199,
"ctxt": 0
},
"value": "StaticToo",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 181,
"end": 233,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 202,
"end": 233,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 208,
"end": 231,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 208,
"end": 231,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 208,
"end": 214,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 208,
"end": 212,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 213,
"end": 214,
"ctxt": 0
},
"value": "i",
"optional": false
}
},
"right": {
"type": "StringLiteral",
"span": {
"start": 217,
"end": 231,
"ctxt": 0
},
"value": "more complex",
"raw": "'more complex'"
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "ExpressionStatement",
"span": {
"start": 234,
"end": 260,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 234,
"end": 260,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 234,
"end": 252,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 234,
"end": 243,
"ctxt": 0
},
"value": "StaticToo",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 244,
"end": 252,
"ctxt": 0
},
"value": "property",
"optional": false
}
},
"right": {
"type": "StringLiteral",
"span": {
"start": 255,
"end": 260,
"ctxt": 0
},
"value": "yep",
"raw": "'yep'"
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 261,
"end": 285,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 265,
"end": 284,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 265,
"end": 266,
"ctxt": 0
},
"value": "s",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NewExpression",
"span": {
"start": 269,
"end": 284,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 273,
"end": 282,
"ctxt": 0
},
"value": "StaticToo",
"optional": false
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 286,
"end": 288,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 286,
"end": 287,
"ctxt": 0
},
"value": "s",
"optional": false
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 289,
"end": 299,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 289,
"end": 298,
"ctxt": 0
},
"value": "StaticToo",
"optional": false
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 319,
"end": 320,
"ctxt": 0
},
"value": "A",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 310,
"end": 383,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 324,
"end": 383,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 330,
"end": 340,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 330,
"end": 340,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 330,
"end": 336,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 330,
"end": 334,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 335,
"end": 336,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 339,
"end": 340,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 366,
"end": 381,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 366,
"end": 381,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 366,
"end": 377,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 366,
"end": 370,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 371,
"end": 377,
"ctxt": 0
},
"value": "second",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 380,
"end": 381,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "ExpressionStatement",
"span": {
"start": 409,
"end": 464,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 409,
"end": 464,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 409,
"end": 422,
"ctxt": 0
},
"object": {
"type": "MemberExpression",
"span": {
"start": 409,
"end": 420,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 409,
"end": 410,
"ctxt": 0
},
"value": "A",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 411,
"end": 420,
"ctxt": 0
},
"value": "prototype",
"optional": false
}
},
"property": {
"type": "Identifier",
"span": {
"start": 421,
"end": 422,
"ctxt": 0
},
"value": "z",
"optional": false
}
},
"right": {
"type": "FunctionExpression",
"identifier": {
"type": "Identifier",
"span": {
"start": 434,
"end": 435,
"ctxt": 0
},
"value": "f",
"optional": false
},
"params": [
{
"type": "Parameter",
"span": {
"start": 436,
"end": 437,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 436,
"end": 437,
"ctxt": 0
},
"value": "n",
"optional": false,
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 425,
"end": 464,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 439,
"end": 464,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 445,
"end": 462,
"ctxt": 0
},
"argument": {
"type": "BinaryExpression",
"span": {
"start": 452,
"end": 462,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "Identifier",
"span": {
"start": 452,
"end": 453,
"ctxt": 0
},
"value": "n",
"optional": false
},
"right": {
"type": "MemberExpression",
"span": {
"start": 456,
"end": 462,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 456,
"end": 460,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 461,
"end": 462,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 490,
"end": 530,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 490,
"end": 530,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 490,
"end": 493,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 490,
"end": 491,
"ctxt": 0
},
"value": "A",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 492,
"end": 493,
"ctxt": 0
},
"value": "t",
"optional": false
}
},
"right": {
"type": "FunctionExpression",
"identifier": {
"type": "Identifier",
"span": {
"start": 505,
"end": 506,
"ctxt": 0
},
"value": "g",
"optional": false
},
"params": [
{
"type": "Parameter",
"span": {
"start": 507,
"end": 508,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 507,
"end": 508,
"ctxt": 0
},
"value": "m",
"optional": false,
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 496,
"end": 530,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 510,
"end": 530,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 516,
"end": 528,
"ctxt": 0
},
"argument": {
"type": "BinaryExpression",
"span": {
"start": 523,
"end": 528,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "Identifier",
"span": {
"start": 523,
"end": 524,
"ctxt": 0
},
"value": "m",
"optional": false
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 527,
"end": 528,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 531,
"end": 546,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 535,
"end": 546,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 535,
"end": 536,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NewExpression",
"span": {
"start": 539,
"end": 546,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 543,
"end": 544,
"ctxt": 0
},
"value": "A",
"optional": false
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 547,
"end": 553,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 547,
"end": 553,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 547,
"end": 550,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 547,
"end": 548,
"ctxt": 0
},
"value": "a",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 549,
"end": 550,
"ctxt": 0
},
"value": "z",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 551,
"end": 552,
"ctxt": 0
},
"value": 3.0,
"raw": "3"
}
}
],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 554,
"end": 560,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 554,
"end": 560,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 554,
"end": 557,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 554,
"end": 555,
"ctxt": 0
},
"value": "A",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 556,
"end": 557,
"ctxt": 0
},
"value": "t",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 558,
"end": 559,
"ctxt": 0
},
"value": 2.0,
"raw": "2"
}
}
],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 561,
"end": 573,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 561,
"end": 573,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 561,
"end": 569,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 561,
"end": 562,
"ctxt": 0
},
"value": "a",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 563,
"end": 569,
"ctxt": 0
},
"value": "second",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 572,
"end": 573,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
}
],
"interpreter": null
}