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

521 lines
13 KiB
JSON

{
"type": "Script",
"span": {
"start": 163,
"end": 507,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 169,
"end": 172,
"ctxt": 0
},
"value": "Foo",
"optional": false
},
"declare": false,
"span": {
"start": 163,
"end": 455,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "Constructor",
"span": {
"start": 241,
"end": 283,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 241,
"end": 252,
"ctxt": 0
},
"value": "constructor",
"optional": false
},
"params": [
{
"type": "Parameter",
"span": {
"start": 254,
"end": 255,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 254,
"end": 255,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
}
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 257,
"end": 283,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 267,
"end": 277,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 267,
"end": 277,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 267,
"end": 273,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 267,
"end": 271,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 272,
"end": 273,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
"right": {
"type": "Identifier",
"span": {
"start": 276,
"end": 277,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
}
]
},
"accessibility": null,
"isOptional": false
},
{
"type": "ClassMethod",
"span": {
"start": 402,
"end": 453,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 402,
"end": 405,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 406,
"end": 407,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 406,
"end": 407,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
}
},
{
"type": "Parameter",
"span": {
"start": 409,
"end": 410,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 409,
"end": 410,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": null
}
},
{
"type": "Parameter",
"span": {
"start": 412,
"end": 417,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 412,
"end": 417,
"ctxt": 0
},
"value": "alpha",
"optional": false,
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 402,
"end": 453,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 419,
"end": 453,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 429,
"end": 447,
"ctxt": 0
},
"argument": {
"type": "CallExpression",
"span": {
"start": 436,
"end": 447,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 436,
"end": 441,
"ctxt": 0
},
"value": "alpha",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "CallExpression",
"span": {
"start": 442,
"end": 446,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 442,
"end": 443,
"ctxt": 0
},
"value": "y",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 444,
"end": 445,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
],
"typeArguments": null
}
}
],
"typeArguments": null
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "VariableDeclaration",
"span": {
"start": 456,
"end": 474,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 460,
"end": 474,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 460,
"end": 461,
"ctxt": 0
},
"value": "f",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NewExpression",
"span": {
"start": 464,
"end": 474,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 468,
"end": 471,
"ctxt": 0
},
"value": "Foo",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 472,
"end": 473,
"ctxt": 0
},
"value": 1.0
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 475,
"end": 497,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 479,
"end": 497,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 479,
"end": 480,
"ctxt": 0
},
"value": "g",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NewExpression",
"span": {
"start": 483,
"end": 497,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 487,
"end": 490,
"ctxt": 0
},
"value": "Foo",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "BooleanLiteral",
"span": {
"start": 491,
"end": 496,
"ctxt": 0
},
"value": false
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 498,
"end": 507,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 498,
"end": 507,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 498,
"end": 501,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 498,
"end": 499,
"ctxt": 0
},
"value": "f",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 500,
"end": 501,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
"right": {
"type": "MemberExpression",
"span": {
"start": 504,
"end": 507,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 504,
"end": 505,
"ctxt": 0
},
"value": "g",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 506,
"end": 507,
"ctxt": 0
},
"value": "a",
"optional": false
}
}
}
}
],
"interpreter": null
}