mirror of
https://github.com/swc-project/swc.git
synced 2024-12-01 01:13:56 +03:00
019cf37199
**Related issue:** - https://github.com/microsoft/TypeScript/pull/51865.
580 lines
14 KiB
JSON
580 lines
14 KiB
JSON
{
|
|
"type": "Script",
|
|
"span": {
|
|
"start": 21,
|
|
"end": 474,
|
|
"ctxt": 0
|
|
},
|
|
"body": [
|
|
{
|
|
"type": "ClassDeclaration",
|
|
"identifier": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 27,
|
|
"end": 33,
|
|
"ctxt": 0
|
|
},
|
|
"value": "Parent",
|
|
"optional": false
|
|
},
|
|
"declare": false,
|
|
"span": {
|
|
"start": 21,
|
|
"end": 261,
|
|
"ctxt": 0
|
|
},
|
|
"decorators": [],
|
|
"body": [
|
|
{
|
|
"type": "PrivateProperty",
|
|
"span": {
|
|
"start": 43,
|
|
"end": 52,
|
|
"ctxt": 0
|
|
},
|
|
"key": {
|
|
"type": "PrivateName",
|
|
"span": {
|
|
"start": 43,
|
|
"end": 47,
|
|
"ctxt": 0
|
|
},
|
|
"id": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 44,
|
|
"end": 47,
|
|
"ctxt": 0
|
|
},
|
|
"value": "foo",
|
|
"optional": false
|
|
}
|
|
},
|
|
"value": {
|
|
"type": "NumericLiteral",
|
|
"span": {
|
|
"start": 50,
|
|
"end": 51,
|
|
"ctxt": 0
|
|
},
|
|
"value": 3.0,
|
|
"raw": "3"
|
|
},
|
|
"typeAnnotation": null,
|
|
"isStatic": false,
|
|
"decorators": [],
|
|
"accessibility": null,
|
|
"isOptional": false,
|
|
"isOverride": false,
|
|
"readonly": false,
|
|
"definite": false
|
|
},
|
|
{
|
|
"type": "PrivateProperty",
|
|
"span": {
|
|
"start": 57,
|
|
"end": 73,
|
|
"ctxt": 0
|
|
},
|
|
"key": {
|
|
"type": "PrivateName",
|
|
"span": {
|
|
"start": 64,
|
|
"end": 68,
|
|
"ctxt": 0
|
|
},
|
|
"id": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 65,
|
|
"end": 68,
|
|
"ctxt": 0
|
|
},
|
|
"value": "bar",
|
|
"optional": false
|
|
}
|
|
},
|
|
"value": {
|
|
"type": "NumericLiteral",
|
|
"span": {
|
|
"start": 71,
|
|
"end": 72,
|
|
"ctxt": 0
|
|
},
|
|
"value": 5.0,
|
|
"raw": "5"
|
|
},
|
|
"typeAnnotation": null,
|
|
"isStatic": true,
|
|
"decorators": [],
|
|
"accessibility": null,
|
|
"isOptional": false,
|
|
"isOverride": false,
|
|
"readonly": false,
|
|
"definite": false
|
|
},
|
|
{
|
|
"type": "ClassMethod",
|
|
"span": {
|
|
"start": 78,
|
|
"end": 259,
|
|
"ctxt": 0
|
|
},
|
|
"key": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 78,
|
|
"end": 94,
|
|
"ctxt": 0
|
|
},
|
|
"value": "accessChildProps",
|
|
"optional": false
|
|
},
|
|
"function": {
|
|
"params": [],
|
|
"decorators": [],
|
|
"span": {
|
|
"start": 78,
|
|
"end": 259,
|
|
"ctxt": 0
|
|
},
|
|
"body": {
|
|
"type": "BlockStatement",
|
|
"span": {
|
|
"start": 97,
|
|
"end": 259,
|
|
"ctxt": 0
|
|
},
|
|
"stmts": [
|
|
{
|
|
"type": "ExpressionStatement",
|
|
"span": {
|
|
"start": 107,
|
|
"end": 132,
|
|
"ctxt": 0
|
|
},
|
|
"expression": {
|
|
"type": "MemberExpression",
|
|
"span": {
|
|
"start": 107,
|
|
"end": 131,
|
|
"ctxt": 0
|
|
},
|
|
"object": {
|
|
"type": "NewExpression",
|
|
"span": {
|
|
"start": 107,
|
|
"end": 126,
|
|
"ctxt": 0
|
|
},
|
|
"callee": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 111,
|
|
"end": 116,
|
|
"ctxt": 0
|
|
},
|
|
"value": "Child",
|
|
"optional": false
|
|
},
|
|
"arguments": [],
|
|
"typeArguments": {
|
|
"type": "TsTypeParameterInstantiation",
|
|
"span": {
|
|
"start": 116,
|
|
"end": 124,
|
|
"ctxt": 0
|
|
},
|
|
"params": [
|
|
{
|
|
"type": "TsKeywordType",
|
|
"span": {
|
|
"start": 117,
|
|
"end": 123,
|
|
"ctxt": 0
|
|
},
|
|
"kind": "string"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"property": {
|
|
"type": "PrivateName",
|
|
"span": {
|
|
"start": 127,
|
|
"end": 131,
|
|
"ctxt": 0
|
|
},
|
|
"id": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 128,
|
|
"end": 131,
|
|
"ctxt": 0
|
|
},
|
|
"value": "foo",
|
|
"optional": false
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"type": "ExpressionStatement",
|
|
"span": {
|
|
"start": 216,
|
|
"end": 227,
|
|
"ctxt": 0
|
|
},
|
|
"expression": {
|
|
"type": "MemberExpression",
|
|
"span": {
|
|
"start": 216,
|
|
"end": 226,
|
|
"ctxt": 0
|
|
},
|
|
"object": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 216,
|
|
"end": 221,
|
|
"ctxt": 0
|
|
},
|
|
"value": "Child",
|
|
"optional": false
|
|
},
|
|
"property": {
|
|
"type": "PrivateName",
|
|
"span": {
|
|
"start": 222,
|
|
"end": 226,
|
|
"ctxt": 0
|
|
},
|
|
"id": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 223,
|
|
"end": 226,
|
|
"ctxt": 0
|
|
},
|
|
"value": "bar",
|
|
"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": {
|
|
"type": "TsTypeParameterDeclaration",
|
|
"span": {
|
|
"start": 33,
|
|
"end": 36,
|
|
"ctxt": 0
|
|
},
|
|
"parameters": [
|
|
{
|
|
"type": "TsTypeParameter",
|
|
"span": {
|
|
"start": 34,
|
|
"end": 35,
|
|
"ctxt": 0
|
|
},
|
|
"name": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 34,
|
|
"end": 35,
|
|
"ctxt": 0
|
|
},
|
|
"value": "T",
|
|
"optional": false
|
|
},
|
|
"in": false,
|
|
"out": false,
|
|
"const": false,
|
|
"constraint": null,
|
|
"default": null
|
|
}
|
|
]
|
|
},
|
|
"superTypeParams": null,
|
|
"implements": []
|
|
},
|
|
{
|
|
"type": "ClassDeclaration",
|
|
"identifier": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 269,
|
|
"end": 274,
|
|
"ctxt": 0
|
|
},
|
|
"value": "Child",
|
|
"optional": false
|
|
},
|
|
"declare": false,
|
|
"span": {
|
|
"start": 263,
|
|
"end": 432,
|
|
"ctxt": 0
|
|
},
|
|
"decorators": [],
|
|
"body": [
|
|
{
|
|
"type": "PrivateProperty",
|
|
"span": {
|
|
"start": 302,
|
|
"end": 315,
|
|
"ctxt": 0
|
|
},
|
|
"key": {
|
|
"type": "PrivateName",
|
|
"span": {
|
|
"start": 302,
|
|
"end": 306,
|
|
"ctxt": 0
|
|
},
|
|
"id": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 303,
|
|
"end": 306,
|
|
"ctxt": 0
|
|
},
|
|
"value": "foo",
|
|
"optional": false
|
|
}
|
|
},
|
|
"value": {
|
|
"type": "StringLiteral",
|
|
"span": {
|
|
"start": 309,
|
|
"end": 314,
|
|
"ctxt": 0
|
|
},
|
|
"value": "foo",
|
|
"raw": "\"foo\""
|
|
},
|
|
"typeAnnotation": null,
|
|
"isStatic": false,
|
|
"decorators": [],
|
|
"accessibility": null,
|
|
"isOptional": false,
|
|
"isOverride": false,
|
|
"readonly": false,
|
|
"definite": false
|
|
},
|
|
{
|
|
"type": "PrivateProperty",
|
|
"span": {
|
|
"start": 405,
|
|
"end": 418,
|
|
"ctxt": 0
|
|
},
|
|
"key": {
|
|
"type": "PrivateName",
|
|
"span": {
|
|
"start": 405,
|
|
"end": 409,
|
|
"ctxt": 0
|
|
},
|
|
"id": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 406,
|
|
"end": 409,
|
|
"ctxt": 0
|
|
},
|
|
"value": "bar",
|
|
"optional": false
|
|
}
|
|
},
|
|
"value": {
|
|
"type": "StringLiteral",
|
|
"span": {
|
|
"start": 412,
|
|
"end": 417,
|
|
"ctxt": 0
|
|
},
|
|
"value": "bar",
|
|
"raw": "\"bar\""
|
|
},
|
|
"typeAnnotation": null,
|
|
"isStatic": false,
|
|
"decorators": [],
|
|
"accessibility": null,
|
|
"isOptional": false,
|
|
"isOverride": false,
|
|
"readonly": false,
|
|
"definite": false
|
|
}
|
|
],
|
|
"superClass": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 286,
|
|
"end": 292,
|
|
"ctxt": 0
|
|
},
|
|
"value": "Parent",
|
|
"optional": false
|
|
},
|
|
"isAbstract": false,
|
|
"typeParams": {
|
|
"type": "TsTypeParameterDeclaration",
|
|
"span": {
|
|
"start": 274,
|
|
"end": 277,
|
|
"ctxt": 0
|
|
},
|
|
"parameters": [
|
|
{
|
|
"type": "TsTypeParameter",
|
|
"span": {
|
|
"start": 275,
|
|
"end": 276,
|
|
"ctxt": 0
|
|
},
|
|
"name": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 275,
|
|
"end": 276,
|
|
"ctxt": 0
|
|
},
|
|
"value": "T",
|
|
"optional": false
|
|
},
|
|
"in": false,
|
|
"out": false,
|
|
"const": false,
|
|
"constraint": null,
|
|
"default": null
|
|
}
|
|
]
|
|
},
|
|
"superTypeParams": {
|
|
"type": "TsTypeParameterInstantiation",
|
|
"span": {
|
|
"start": 292,
|
|
"end": 295,
|
|
"ctxt": 0
|
|
},
|
|
"params": [
|
|
{
|
|
"type": "TsTypeReference",
|
|
"span": {
|
|
"start": 293,
|
|
"end": 294,
|
|
"ctxt": 0
|
|
},
|
|
"typeName": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 293,
|
|
"end": 294,
|
|
"ctxt": 0
|
|
},
|
|
"value": "T",
|
|
"optional": false
|
|
},
|
|
"typeParams": null
|
|
}
|
|
]
|
|
},
|
|
"implements": []
|
|
},
|
|
{
|
|
"type": "ExpressionStatement",
|
|
"span": {
|
|
"start": 434,
|
|
"end": 474,
|
|
"ctxt": 0
|
|
},
|
|
"expression": {
|
|
"type": "CallExpression",
|
|
"span": {
|
|
"start": 434,
|
|
"end": 473,
|
|
"ctxt": 0
|
|
},
|
|
"callee": {
|
|
"type": "MemberExpression",
|
|
"span": {
|
|
"start": 434,
|
|
"end": 471,
|
|
"ctxt": 0
|
|
},
|
|
"object": {
|
|
"type": "NewExpression",
|
|
"span": {
|
|
"start": 434,
|
|
"end": 454,
|
|
"ctxt": 0
|
|
},
|
|
"callee": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 438,
|
|
"end": 444,
|
|
"ctxt": 0
|
|
},
|
|
"value": "Parent",
|
|
"optional": false
|
|
},
|
|
"arguments": [],
|
|
"typeArguments": {
|
|
"type": "TsTypeParameterInstantiation",
|
|
"span": {
|
|
"start": 444,
|
|
"end": 452,
|
|
"ctxt": 0
|
|
},
|
|
"params": [
|
|
{
|
|
"type": "TsKeywordType",
|
|
"span": {
|
|
"start": 445,
|
|
"end": 451,
|
|
"ctxt": 0
|
|
},
|
|
"kind": "number"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"property": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 455,
|
|
"end": 471,
|
|
"ctxt": 0
|
|
},
|
|
"value": "accessChildProps",
|
|
"optional": false
|
|
}
|
|
},
|
|
"arguments": [],
|
|
"typeArguments": null
|
|
}
|
|
}
|
|
],
|
|
"interpreter": null
|
|
}
|