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

351 lines
8.7 KiB
JSON

{
"type": "Module",
"span": {
"start": 213,
"end": 647,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 213,
"end": 241,
"ctxt": 0
},
"declaration": {
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 229,
"end": 232,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 233,
"end": 234,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 233,
"end": 234,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": null
}
},
{
"type": "Parameter",
"span": {
"start": 236,
"end": 237,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 236,
"end": 237,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 220,
"end": 241,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 239,
"end": 241,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
},
{
"type": "ExportDeclaration",
"span": {
"start": 274,
"end": 591,
"ctxt": 0
},
"declaration": {
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 287,
"end": 292,
"ctxt": 0
},
"value": "Aleph",
"optional": false
},
"declare": false,
"span": {
"start": 281,
"end": 591,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "Constructor",
"span": {
"start": 394,
"end": 499,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 394,
"end": 405,
"ctxt": 0
},
"value": "constructor",
"optional": false
},
"params": [
{
"type": "Parameter",
"span": {
"start": 406,
"end": 407,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 406,
"end": 407,
"ctxt": 0
},
"value": "a",
"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": "b",
"optional": false,
"typeAnnotation": null
}
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 412,
"end": 499,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 478,
"end": 493,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 478,
"end": 492,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 478,
"end": 488,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 478,
"end": 482,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 483,
"end": 488,
"ctxt": 0
},
"value": "field",
"optional": false
}
},
"right": {
"type": "Identifier",
"span": {
"start": 491,
"end": 492,
"ctxt": 0
},
"value": "b",
"optional": false
}
}
}
]
},
"accessibility": null,
"isOptional": false
},
{
"type": "ClassMethod",
"span": {
"start": 580,
"end": 589,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 580,
"end": 584,
"ctxt": 0
},
"value": "doIt",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 580,
"end": 589,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 587,
"end": 589,
"ctxt": 0
},
"stmts": []
},
"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": "ExportDeclaration",
"span": {
"start": 627,
"end": 647,
"ctxt": 0
},
"declaration": {
"type": "VariableDeclaration",
"span": {
"start": 634,
"end": 647,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 640,
"end": 646,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 640,
"end": 641,
"ctxt": 0
},
"value": "c",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NumericLiteral",
"span": {
"start": 644,
"end": 646,
"ctxt": 0
},
"value": 12.0,
"raw": "12"
},
"definite": false
}
]
}
}
],
"interpreter": null
}