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

371 lines
8.6 KiB
JSON

{
"type": "Script",
"span": {
"start": 1,
"end": 180,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 7,
"end": 8,
"ctxt": 0
},
"value": "C",
"optional": false
},
"declare": false,
"span": {
"start": 1,
"end": 88,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 15,
"end": 27,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 15,
"end": 18,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"value": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 18,
"end": 26,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 20,
"end": 26,
"ctxt": 0
},
"kind": "string"
}
},
"isStatic": false,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
},
{
"type": "Constructor",
"span": {
"start": 32,
"end": 51,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 32,
"end": 43,
"ctxt": 0
},
"value": "constructor",
"optional": false
},
"params": [
{
"type": "Parameter",
"span": {
"start": 44,
"end": 49,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "AssignmentPattern",
"span": {
"start": 44,
"end": 49,
"ctxt": 0
},
"left": {
"type": "Identifier",
"span": {
"start": 44,
"end": 45,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 48,
"end": 49,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
},
"typeAnnotation": null
}
}
],
"body": null,
"accessibility": null,
"isOptional": false
},
{
"type": "Constructor",
"span": {
"start": 65,
"end": 86,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 65,
"end": 76,
"ctxt": 0
},
"value": "constructor",
"optional": false
},
"params": [],
"body": {
"type": "BlockStatement",
"span": {
"start": 79,
"end": 86,
"ctxt": 0
},
"stmts": []
},
"accessibility": null,
"isOptional": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 96,
"end": 97,
"ctxt": 0
},
"value": "D",
"optional": false
},
"declare": false,
"span": {
"start": 90,
"end": 180,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 107,
"end": 119,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 107,
"end": 110,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"value": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 110,
"end": 118,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 112,
"end": 118,
"ctxt": 0
},
"kind": "string"
}
},
"isStatic": false,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
},
{
"type": "Constructor",
"span": {
"start": 124,
"end": 143,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 124,
"end": 135,
"ctxt": 0
},
"value": "constructor",
"optional": false
},
"params": [
{
"type": "Parameter",
"span": {
"start": 136,
"end": 141,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "AssignmentPattern",
"span": {
"start": 136,
"end": 141,
"ctxt": 0
},
"left": {
"type": "Identifier",
"span": {
"start": 136,
"end": 137,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 140,
"end": 141,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
},
"typeAnnotation": null
}
}
],
"body": null,
"accessibility": null,
"isOptional": false
},
{
"type": "Constructor",
"span": {
"start": 157,
"end": 178,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 157,
"end": 168,
"ctxt": 0
},
"value": "constructor",
"optional": false
},
"params": [],
"body": {
"type": "BlockStatement",
"span": {
"start": 171,
"end": 178,
"ctxt": 0
},
"stmts": []
},
"accessibility": null,
"isOptional": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 97,
"end": 100,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 98,
"end": 99,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 98,
"end": 99,
"ctxt": 0
},
"value": "T",
"optional": false
},
"in": false,
"out": false,
"constraint": null,
"default": null
}
]
},
"superTypeParams": null,
"implements": []
}
],
"interpreter": null
}