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

762 lines
19 KiB
JSON

{
"type": "Script",
"span": {
"start": 143,
"end": 646,
"ctxt": 0
},
"body": [
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 152,
"end": 155,
"ctxt": 0
},
"value": "Zet",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 156,
"end": 157,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 156,
"end": 157,
"ctxt": 0
},
"value": "t",
"optional": false,
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 143,
"end": 209,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 159,
"end": 209,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 186,
"end": 192,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 186,
"end": 192,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 186,
"end": 190,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 191,
"end": 192,
"ctxt": 0
},
"value": "u",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 197,
"end": 207,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 197,
"end": 207,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 197,
"end": 203,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 197,
"end": 201,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 202,
"end": 203,
"ctxt": 0
},
"value": "t",
"optional": false
}
},
"right": {
"type": "Identifier",
"span": {
"start": 206,
"end": 207,
"ctxt": 0
},
"value": "t",
"optional": false
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "ExpressionStatement",
"span": {
"start": 278,
"end": 361,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 278,
"end": 361,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 278,
"end": 295,
"ctxt": 0
},
"object": {
"type": "MemberExpression",
"span": {
"start": 278,
"end": 291,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 278,
"end": 281,
"ctxt": 0
},
"value": "Zet",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 282,
"end": 291,
"ctxt": 0
},
"value": "prototype",
"optional": false
}
},
"property": {
"type": "Identifier",
"span": {
"start": 292,
"end": 295,
"ctxt": 0
},
"value": "add",
"optional": false
}
},
"right": {
"type": "FunctionExpression",
"identifier": null,
"params": [
{
"type": "Parameter",
"span": {
"start": 307,
"end": 308,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 307,
"end": 308,
"ctxt": 0
},
"value": "v",
"optional": false,
"typeAnnotation": null
}
},
{
"type": "Parameter",
"span": {
"start": 310,
"end": 311,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 310,
"end": 311,
"ctxt": 0
},
"value": "o",
"optional": false,
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 298,
"end": 361,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 313,
"end": 361,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 319,
"end": 341,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 319,
"end": 341,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 319,
"end": 325,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 319,
"end": 323,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 324,
"end": 325,
"ctxt": 0
},
"value": "u",
"optional": false
}
},
"right": {
"type": "BinaryExpression",
"span": {
"start": 328,
"end": 341,
"ctxt": 0
},
"operator": "||",
"left": {
"type": "Identifier",
"span": {
"start": 328,
"end": 329,
"ctxt": 0
},
"value": "v",
"optional": false
},
"right": {
"type": "MemberExpression",
"span": {
"start": 333,
"end": 341,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 333,
"end": 334,
"ctxt": 0
},
"value": "o",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 335,
"end": 341,
"ctxt": 0
},
"value": "nested",
"optional": false
}
}
}
}
},
{
"type": "ReturnStatement",
"span": {
"start": 346,
"end": 359,
"ctxt": 0
},
"argument": {
"type": "MemberExpression",
"span": {
"start": 353,
"end": 359,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 353,
"end": 357,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 358,
"end": 359,
"ctxt": 0
},
"value": "u",
"optional": false
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 362,
"end": 380,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 366,
"end": 380,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 366,
"end": 367,
"ctxt": 0
},
"value": "z",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NewExpression",
"span": {
"start": 370,
"end": 380,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 374,
"end": 377,
"ctxt": 0
},
"value": "Zet",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 378,
"end": 379,
"ctxt": 0
},
"value": 1.0
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 381,
"end": 388,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 381,
"end": 388,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 381,
"end": 384,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 381,
"end": 382,
"ctxt": 0
},
"value": "z",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 383,
"end": 384,
"ctxt": 0
},
"value": "t",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 387,
"end": 388,
"ctxt": 0
},
"value": 2.0
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 389,
"end": 400,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 389,
"end": 400,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 389,
"end": 392,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 389,
"end": 390,
"ctxt": 0
},
"value": "z",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 391,
"end": 392,
"ctxt": 0
},
"value": "u",
"optional": false
}
},
"right": {
"type": "BooleanLiteral",
"span": {
"start": 395,
"end": 400,
"ctxt": 0
},
"value": false
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 423,
"end": 459,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 427,
"end": 459,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 427,
"end": 433,
"ctxt": 0
},
"value": "answer",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 436,
"end": 459,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 436,
"end": 441,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 436,
"end": 437,
"ctxt": 0
},
"value": "z",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 438,
"end": 441,
"ctxt": 0
},
"value": "add",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 442,
"end": 443,
"ctxt": 0
},
"value": 3.0
}
},
{
"spread": null,
"expression": {
"type": "ObjectExpression",
"span": {
"start": 445,
"end": 458,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 447,
"end": 453,
"ctxt": 0
},
"value": "nested",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 455,
"end": 456,
"ctxt": 0
},
"value": 4.0
}
}
]
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 614,
"end": 646,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 620,
"end": 645,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 620,
"end": 627,
"ctxt": 0
},
"value": "options",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ObjectExpression",
"span": {
"start": 630,
"end": 645,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 632,
"end": 637,
"ctxt": 0
},
"value": "value",
"optional": false
},
"value": {
"type": "NullLiteral",
"span": {
"start": 639,
"end": 643,
"ctxt": 0
}
}
}
]
},
"definite": false
}
]
}
],
"interpreter": null
}