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

715 lines
20 KiB
JSON

{
"type": "Module",
"span": {
"start": 125,
"end": 749,
"ctxt": 0
},
"body": [
{
"type": "ExportNamedDeclaration",
"span": {
"start": 125,
"end": 136,
"ctxt": 0
},
"specifiers": [],
"source": null,
"typeOnly": false,
"asserts": null
},
{
"type": "TsModuleDeclaration",
"span": {
"start": 137,
"end": 247,
"ctxt": 0
},
"declare": true,
"global": false,
"id": {
"type": "StringLiteral",
"span": {
"start": 152,
"end": 167,
"ctxt": 0
},
"value": "./argument.js",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 168,
"end": 247,
"ctxt": 0
},
"body": [
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 174,
"end": 245,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 184,
"end": 192,
"ctxt": 0
},
"value": "Argument",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 193,
"end": 245,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 203,
"end": 216,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 203,
"end": 210,
"ctxt": 0
},
"value": "idlType",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 210,
"end": 215,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 212,
"end": 215,
"ctxt": 0
},
"kind": "any"
}
},
"typeParams": null
},
{
"type": "TsPropertySignature",
"span": {
"start": 225,
"end": 239,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 225,
"end": 232,
"ctxt": 0
},
"value": "default",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 232,
"end": 238,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 234,
"end": 238,
"ctxt": 0
},
"kind": "null"
}
},
"typeParams": null
}
]
}
}
]
}
},
{
"type": "ExportDeclaration",
"span": {
"start": 270,
"end": 439,
"ctxt": 0
},
"declaration": {
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 283,
"end": 287,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"declare": false,
"span": {
"start": 277,
"end": 439,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "Constructor",
"span": {
"start": 294,
"end": 311,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 294,
"end": 305,
"ctxt": 0
},
"value": "constructor",
"optional": false
},
"params": [],
"body": {
"type": "BlockStatement",
"span": {
"start": 308,
"end": 311,
"ctxt": 0
},
"stmts": []
},
"accessibility": null,
"isOptional": false
},
{
"type": "ClassMethod",
"span": {
"start": 317,
"end": 437,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 317,
"end": 323,
"ctxt": 0
},
"value": "toJSON",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 317,
"end": 437,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 326,
"end": 437,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 336,
"end": 410,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 342,
"end": 409,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 342,
"end": 346,
"ctxt": 0
},
"value": "json",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ObjectExpression",
"span": {
"start": 349,
"end": 409,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 351,
"end": 355,
"ctxt": 0
},
"value": "type",
"optional": false
},
"value": {
"type": "Identifier",
"span": {
"start": 357,
"end": 366,
"ctxt": 0
},
"value": "undefined",
"optional": false
}
},
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 368,
"end": 372,
"ctxt": 0
},
"value": "name",
"optional": false
},
"value": {
"type": "Identifier",
"span": {
"start": 374,
"end": 383,
"ctxt": 0
},
"value": "undefined",
"optional": false
}
},
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 385,
"end": 396,
"ctxt": 0
},
"value": "inheritance",
"optional": false
},
"value": {
"type": "Identifier",
"span": {
"start": 398,
"end": 407,
"ctxt": 0
},
"value": "undefined",
"optional": false
}
}
]
},
"definite": false
}
]
},
{
"type": "ReturnStatement",
"span": {
"start": 419,
"end": 431,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 426,
"end": 430,
"ctxt": 0
},
"value": "json",
"optional": false
}
}
]
},
"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": "ImportDeclaration",
"span": {
"start": 466,
"end": 499,
"ctxt": 0
},
"specifiers": [
{
"type": "ImportSpecifier",
"span": {
"start": 475,
"end": 479,
"ctxt": 0
},
"local": {
"type": "Identifier",
"span": {
"start": 475,
"end": 479,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"imported": null,
"isTypeOnly": false
}
],
"source": {
"type": "StringLiteral",
"span": {
"start": 487,
"end": 498,
"ctxt": 0
},
"value": "./base.js",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
},
"typeOnly": false,
"asserts": null
},
{
"type": "ExportDeclaration",
"span": {
"start": 500,
"end": 749,
"ctxt": 0
},
"declaration": {
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 513,
"end": 521,
"ctxt": 0
},
"value": "Argument",
"optional": false
},
"declare": false,
"span": {
"start": 507,
"end": 749,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 585,
"end": 632,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 592,
"end": 597,
"ctxt": 0
},
"value": "parse",
"optional": false
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 598,
"end": 607,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 598,
"end": 607,
"ctxt": 0
},
"value": "tokeniser",
"optional": false,
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 585,
"end": 632,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 609,
"end": 632,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 619,
"end": 626,
"ctxt": 0
},
"argument": null
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": true,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
"start": 638,
"end": 683,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 642,
"end": 646,
"ctxt": 0
},
"value": "type",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 638,
"end": 683,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 649,
"end": 683,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 659,
"end": 677,
"ctxt": 0
},
"argument": {
"type": "StringLiteral",
"span": {
"start": 666,
"end": 676,
"ctxt": 0
},
"value": "argument",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "getter",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
"start": 728,
"end": 747,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 729,
"end": 737,
"ctxt": 0
},
"value": "validate",
"optional": false
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 738,
"end": 742,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 738,
"end": 742,
"ctxt": 0
},
"value": "defs",
"optional": false,
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 728,
"end": 747,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 744,
"end": 747,
"ctxt": 0
},
"stmts": []
},
"generator": true,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
}
],
"superClass": {
"type": "Identifier",
"span": {
"start": 530,
"end": 534,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
}
}
],
"interpreter": null
}