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

876 lines
23 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 0,
"end": 352,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 6,
"end": 7,
"ctxt": 0
},
"value": "C",
"optional": false
},
"declare": false,
"span": {
"start": 0,
"end": 105,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "Constructor",
"span": {
"start": 14,
"end": 29,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 14,
"end": 25,
"ctxt": 0
},
"value": "constructor",
"optional": false
},
"params": [
{
"type": "Parameter",
"span": {
"start": 26,
"end": 27,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 26,
"end": 27,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
}
}
],
"body": null,
"accessibility": null,
"isOptional": false
},
{
"type": "Constructor",
"span": {
"start": 34,
"end": 103,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 34,
"end": 45,
"ctxt": 0
},
"value": "constructor",
"optional": false
},
"params": [
{
"type": "TsParameterProperty",
"span": {
"start": 46,
"end": 66,
"ctxt": 0
},
"decorators": [],
"accessibility": "public",
"override": false,
"readonly": false,
"param": {
"type": "AssignmentPattern",
"span": {
"start": 53,
"end": 66,
"ctxt": 0
},
"left": {
"type": "Identifier",
"span": {
"start": 53,
"end": 62,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 54,
"end": 62,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 56,
"end": 62,
"ctxt": 0
},
"kind": "string"
}
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 65,
"end": 66,
"ctxt": 0
},
"value": 1.0
},
"typeAnnotation": null
}
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 68,
"end": 103,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 87,
"end": 97,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 91,
"end": 96,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 91,
"end": 92,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "Identifier",
"span": {
"start": 95,
"end": 96,
"ctxt": 0
},
"value": "x",
"optional": false
},
"definite": false
}
]
}
]
},
"accessibility": null,
"isOptional": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 113,
"end": 114,
"ctxt": 0
},
"value": "D",
"optional": false
},
"declare": false,
"span": {
"start": 107,
"end": 232,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "Constructor",
"span": {
"start": 127,
"end": 151,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 127,
"end": 138,
"ctxt": 0
},
"value": "constructor",
"optional": false
},
"params": [
{
"type": "Parameter",
"span": {
"start": 139,
"end": 143,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 139,
"end": 143,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 140,
"end": 143,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 142,
"end": 143,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 142,
"end": 143,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
}
}
},
{
"type": "Parameter",
"span": {
"start": 145,
"end": 149,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 145,
"end": 149,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 146,
"end": 149,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 148,
"end": 149,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 148,
"end": 149,
"ctxt": 0
},
"value": "U",
"optional": false
},
"typeParams": null
}
}
}
}
],
"body": null,
"accessibility": null,
"isOptional": false
},
{
"type": "Constructor",
"span": {
"start": 156,
"end": 230,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 156,
"end": 167,
"ctxt": 0
},
"value": "constructor",
"optional": false
},
"params": [
{
"type": "Parameter",
"span": {
"start": 168,
"end": 176,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "AssignmentPattern",
"span": {
"start": 168,
"end": 176,
"ctxt": 0
},
"left": {
"type": "Identifier",
"span": {
"start": 168,
"end": 172,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 169,
"end": 172,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 171,
"end": 172,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 171,
"end": 172,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 175,
"end": 176,
"ctxt": 0
},
"value": 1.0
},
"typeAnnotation": null
}
},
{
"type": "TsParameterProperty",
"span": {
"start": 178,
"end": 193,
"ctxt": 0
},
"decorators": [],
"accessibility": "public",
"override": false,
"readonly": false,
"param": {
"type": "AssignmentPattern",
"span": {
"start": 185,
"end": 193,
"ctxt": 0
},
"left": {
"type": "Identifier",
"span": {
"start": 185,
"end": 189,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 186,
"end": 189,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 188,
"end": 189,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 188,
"end": 189,
"ctxt": 0
},
"value": "U",
"optional": false
},
"typeParams": null
}
}
},
"right": {
"type": "Identifier",
"span": {
"start": 192,
"end": 193,
"ctxt": 0
},
"value": "x",
"optional": false
},
"typeAnnotation": null
}
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 195,
"end": 230,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 214,
"end": 224,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 218,
"end": 223,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 218,
"end": 219,
"ctxt": 0
},
"value": "z",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "Identifier",
"span": {
"start": 222,
"end": 223,
"ctxt": 0
},
"value": "x",
"optional": false
},
"definite": false
}
]
}
]
},
"accessibility": null,
"isOptional": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 114,
"end": 120,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 115,
"end": 116,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 115,
"end": 116,
"ctxt": 0
},
"value": "T",
"optional": false
},
"constraint": null,
"default": null
},
{
"type": "TsTypeParameter",
"span": {
"start": 118,
"end": 119,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 118,
"end": 119,
"ctxt": 0
},
"value": "U",
"optional": false
},
"constraint": null,
"default": null
}
]
},
"superTypeParams": null,
"implements": []
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 240,
"end": 241,
"ctxt": 0
},
"value": "E",
"optional": false
},
"declare": false,
"span": {
"start": 234,
"end": 352,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "Constructor",
"span": {
"start": 264,
"end": 279,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 264,
"end": 275,
"ctxt": 0
},
"value": "constructor",
"optional": false
},
"params": [
{
"type": "Parameter",
"span": {
"start": 276,
"end": 277,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 276,
"end": 277,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
}
}
],
"body": null,
"accessibility": null,
"isOptional": false
},
{
"type": "Constructor",
"span": {
"start": 284,
"end": 350,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 284,
"end": 295,
"ctxt": 0
},
"value": "constructor",
"optional": false
},
"params": [
{
"type": "Parameter",
"span": {
"start": 296,
"end": 313,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "AssignmentPattern",
"span": {
"start": 296,
"end": 313,
"ctxt": 0
},
"left": {
"type": "Identifier",
"span": {
"start": 296,
"end": 300,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 297,
"end": 300,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 299,
"end": 300,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 299,
"end": 300,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
}
},
"right": {
"type": "NewExpression",
"span": {
"start": 303,
"end": 313,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 307,
"end": 311,
"ctxt": 0
},
"value": "Date",
"optional": false
},
"arguments": [],
"typeArguments": null
},
"typeAnnotation": null
}
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 315,
"end": 350,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 334,
"end": 344,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 338,
"end": 343,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 338,
"end": 339,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "Identifier",
"span": {
"start": 342,
"end": 343,
"ctxt": 0
},
"value": "x",
"optional": false
},
"definite": false
}
]
}
]
},
"accessibility": null,
"isOptional": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 241,
"end": 257,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 242,
"end": 256,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 242,
"end": 243,
"ctxt": 0
},
"value": "T",
"optional": false
},
"constraint": {
"type": "TsTypeReference",
"span": {
"start": 252,
"end": 256,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 252,
"end": 256,
"ctxt": 0
},
"value": "Date",
"optional": false
},
"typeParams": null
},
"default": null
}
]
},
"superTypeParams": null,
"implements": []
}
],
"interpreter": null
}