mirror of
https://github.com/swc-project/swc.git
synced 2024-12-03 00:54:25 +03:00
1731 lines
50 KiB
JSON
1731 lines
50 KiB
JSON
{
|
|
"type": "Script",
|
|
"span": {
|
|
"start": 94,
|
|
"end": 1151,
|
|
"ctxt": 0
|
|
},
|
|
"body": [
|
|
{
|
|
"type": "FunctionDeclaration",
|
|
"identifier": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 103,
|
|
"end": 107,
|
|
"ctxt": 0
|
|
},
|
|
"value": "foo1",
|
|
"optional": false
|
|
},
|
|
"declare": false,
|
|
"params": [
|
|
{
|
|
"type": "Parameter",
|
|
"span": {
|
|
"start": 108,
|
|
"end": 137,
|
|
"ctxt": 0
|
|
},
|
|
"decorators": [],
|
|
"pat": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 108,
|
|
"end": 137,
|
|
"ctxt": 0
|
|
},
|
|
"value": "results",
|
|
"optional": false,
|
|
"typeAnnotation": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 115,
|
|
"end": 137,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsUnionType",
|
|
"span": {
|
|
"start": 117,
|
|
"end": 137,
|
|
"ctxt": 0
|
|
},
|
|
"types": [
|
|
{
|
|
"type": "TsArrayType",
|
|
"span": {
|
|
"start": 117,
|
|
"end": 125,
|
|
"ctxt": 0
|
|
},
|
|
"elemType": {
|
|
"type": "TsKeywordType",
|
|
"span": {
|
|
"start": 117,
|
|
"end": 123,
|
|
"ctxt": 0
|
|
},
|
|
"kind": "number"
|
|
}
|
|
},
|
|
{
|
|
"type": "TsKeywordType",
|
|
"span": {
|
|
"start": 128,
|
|
"end": 137,
|
|
"ctxt": 0
|
|
},
|
|
"kind": "undefined"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"decorators": [],
|
|
"span": {
|
|
"start": 94,
|
|
"end": 174,
|
|
"ctxt": 0
|
|
},
|
|
"body": {
|
|
"type": "BlockStatement",
|
|
"span": {
|
|
"start": 139,
|
|
"end": 174,
|
|
"ctxt": 0
|
|
},
|
|
"stmts": [
|
|
{
|
|
"type": "ExpressionStatement",
|
|
"span": {
|
|
"start": 145,
|
|
"end": 172,
|
|
"ctxt": 0
|
|
},
|
|
"expression": {
|
|
"type": "CallExpression",
|
|
"span": {
|
|
"start": 145,
|
|
"end": 171,
|
|
"ctxt": 0
|
|
},
|
|
"callee": {
|
|
"type": "MemberExpression",
|
|
"span": {
|
|
"start": 145,
|
|
"end": 166,
|
|
"ctxt": 0
|
|
},
|
|
"object": {
|
|
"type": "ParenthesisExpression",
|
|
"span": {
|
|
"start": 145,
|
|
"end": 161,
|
|
"ctxt": 0
|
|
},
|
|
"expression": {
|
|
"type": "AssignmentExpression",
|
|
"span": {
|
|
"start": 146,
|
|
"end": 160,
|
|
"ctxt": 0
|
|
},
|
|
"operator": "||=",
|
|
"left": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 146,
|
|
"end": 153,
|
|
"ctxt": 0
|
|
},
|
|
"value": "results",
|
|
"optional": false,
|
|
"typeAnnotation": null
|
|
},
|
|
"right": {
|
|
"type": "ArrayExpression",
|
|
"span": {
|
|
"start": 158,
|
|
"end": 160,
|
|
"ctxt": 0
|
|
},
|
|
"elements": []
|
|
}
|
|
}
|
|
},
|
|
"property": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 162,
|
|
"end": 166,
|
|
"ctxt": 0
|
|
},
|
|
"value": "push",
|
|
"optional": false
|
|
}
|
|
},
|
|
"arguments": [
|
|
{
|
|
"spread": null,
|
|
"expression": {
|
|
"type": "NumericLiteral",
|
|
"span": {
|
|
"start": 167,
|
|
"end": 170,
|
|
"ctxt": 0
|
|
},
|
|
"value": 100.0,
|
|
"raw": "100"
|
|
}
|
|
}
|
|
],
|
|
"typeArguments": null
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"generator": false,
|
|
"async": false,
|
|
"typeParameters": null,
|
|
"returnType": null
|
|
},
|
|
{
|
|
"type": "FunctionDeclaration",
|
|
"identifier": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 185,
|
|
"end": 189,
|
|
"ctxt": 0
|
|
},
|
|
"value": "foo2",
|
|
"optional": false
|
|
},
|
|
"declare": false,
|
|
"params": [
|
|
{
|
|
"type": "Parameter",
|
|
"span": {
|
|
"start": 190,
|
|
"end": 219,
|
|
"ctxt": 0
|
|
},
|
|
"decorators": [],
|
|
"pat": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 190,
|
|
"end": 219,
|
|
"ctxt": 0
|
|
},
|
|
"value": "results",
|
|
"optional": false,
|
|
"typeAnnotation": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 197,
|
|
"end": 219,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsUnionType",
|
|
"span": {
|
|
"start": 199,
|
|
"end": 219,
|
|
"ctxt": 0
|
|
},
|
|
"types": [
|
|
{
|
|
"type": "TsArrayType",
|
|
"span": {
|
|
"start": 199,
|
|
"end": 207,
|
|
"ctxt": 0
|
|
},
|
|
"elemType": {
|
|
"type": "TsKeywordType",
|
|
"span": {
|
|
"start": 199,
|
|
"end": 205,
|
|
"ctxt": 0
|
|
},
|
|
"kind": "number"
|
|
}
|
|
},
|
|
{
|
|
"type": "TsKeywordType",
|
|
"span": {
|
|
"start": 210,
|
|
"end": 219,
|
|
"ctxt": 0
|
|
},
|
|
"kind": "undefined"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"decorators": [],
|
|
"span": {
|
|
"start": 176,
|
|
"end": 256,
|
|
"ctxt": 0
|
|
},
|
|
"body": {
|
|
"type": "BlockStatement",
|
|
"span": {
|
|
"start": 221,
|
|
"end": 256,
|
|
"ctxt": 0
|
|
},
|
|
"stmts": [
|
|
{
|
|
"type": "ExpressionStatement",
|
|
"span": {
|
|
"start": 227,
|
|
"end": 254,
|
|
"ctxt": 0
|
|
},
|
|
"expression": {
|
|
"type": "CallExpression",
|
|
"span": {
|
|
"start": 227,
|
|
"end": 253,
|
|
"ctxt": 0
|
|
},
|
|
"callee": {
|
|
"type": "MemberExpression",
|
|
"span": {
|
|
"start": 227,
|
|
"end": 248,
|
|
"ctxt": 0
|
|
},
|
|
"object": {
|
|
"type": "ParenthesisExpression",
|
|
"span": {
|
|
"start": 227,
|
|
"end": 243,
|
|
"ctxt": 0
|
|
},
|
|
"expression": {
|
|
"type": "AssignmentExpression",
|
|
"span": {
|
|
"start": 228,
|
|
"end": 242,
|
|
"ctxt": 0
|
|
},
|
|
"operator": "??=",
|
|
"left": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 228,
|
|
"end": 235,
|
|
"ctxt": 0
|
|
},
|
|
"value": "results",
|
|
"optional": false,
|
|
"typeAnnotation": null
|
|
},
|
|
"right": {
|
|
"type": "ArrayExpression",
|
|
"span": {
|
|
"start": 240,
|
|
"end": 242,
|
|
"ctxt": 0
|
|
},
|
|
"elements": []
|
|
}
|
|
}
|
|
},
|
|
"property": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 244,
|
|
"end": 248,
|
|
"ctxt": 0
|
|
},
|
|
"value": "push",
|
|
"optional": false
|
|
}
|
|
},
|
|
"arguments": [
|
|
{
|
|
"spread": null,
|
|
"expression": {
|
|
"type": "NumericLiteral",
|
|
"span": {
|
|
"start": 249,
|
|
"end": 252,
|
|
"ctxt": 0
|
|
},
|
|
"value": 100.0,
|
|
"raw": "100"
|
|
}
|
|
}
|
|
],
|
|
"typeArguments": null
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"generator": false,
|
|
"async": false,
|
|
"typeParameters": null,
|
|
"returnType": null
|
|
},
|
|
{
|
|
"type": "FunctionDeclaration",
|
|
"identifier": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 267,
|
|
"end": 271,
|
|
"ctxt": 0
|
|
},
|
|
"value": "foo3",
|
|
"optional": false
|
|
},
|
|
"declare": false,
|
|
"params": [
|
|
{
|
|
"type": "Parameter",
|
|
"span": {
|
|
"start": 272,
|
|
"end": 301,
|
|
"ctxt": 0
|
|
},
|
|
"decorators": [],
|
|
"pat": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 272,
|
|
"end": 301,
|
|
"ctxt": 0
|
|
},
|
|
"value": "results",
|
|
"optional": false,
|
|
"typeAnnotation": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 279,
|
|
"end": 301,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsUnionType",
|
|
"span": {
|
|
"start": 281,
|
|
"end": 301,
|
|
"ctxt": 0
|
|
},
|
|
"types": [
|
|
{
|
|
"type": "TsArrayType",
|
|
"span": {
|
|
"start": 281,
|
|
"end": 289,
|
|
"ctxt": 0
|
|
},
|
|
"elemType": {
|
|
"type": "TsKeywordType",
|
|
"span": {
|
|
"start": 281,
|
|
"end": 287,
|
|
"ctxt": 0
|
|
},
|
|
"kind": "number"
|
|
}
|
|
},
|
|
{
|
|
"type": "TsKeywordType",
|
|
"span": {
|
|
"start": 292,
|
|
"end": 301,
|
|
"ctxt": 0
|
|
},
|
|
"kind": "undefined"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"decorators": [],
|
|
"span": {
|
|
"start": 258,
|
|
"end": 349,
|
|
"ctxt": 0
|
|
},
|
|
"body": {
|
|
"type": "BlockStatement",
|
|
"span": {
|
|
"start": 303,
|
|
"end": 349,
|
|
"ctxt": 0
|
|
},
|
|
"stmts": [
|
|
{
|
|
"type": "ExpressionStatement",
|
|
"span": {
|
|
"start": 309,
|
|
"end": 324,
|
|
"ctxt": 0
|
|
},
|
|
"expression": {
|
|
"type": "AssignmentExpression",
|
|
"span": {
|
|
"start": 309,
|
|
"end": 323,
|
|
"ctxt": 0
|
|
},
|
|
"operator": "||=",
|
|
"left": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 309,
|
|
"end": 316,
|
|
"ctxt": 0
|
|
},
|
|
"value": "results",
|
|
"optional": false,
|
|
"typeAnnotation": null
|
|
},
|
|
"right": {
|
|
"type": "ArrayExpression",
|
|
"span": {
|
|
"start": 321,
|
|
"end": 323,
|
|
"ctxt": 0
|
|
},
|
|
"elements": []
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"type": "ExpressionStatement",
|
|
"span": {
|
|
"start": 329,
|
|
"end": 347,
|
|
"ctxt": 0
|
|
},
|
|
"expression": {
|
|
"type": "CallExpression",
|
|
"span": {
|
|
"start": 329,
|
|
"end": 346,
|
|
"ctxt": 0
|
|
},
|
|
"callee": {
|
|
"type": "MemberExpression",
|
|
"span": {
|
|
"start": 329,
|
|
"end": 341,
|
|
"ctxt": 0
|
|
},
|
|
"object": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 329,
|
|
"end": 336,
|
|
"ctxt": 0
|
|
},
|
|
"value": "results",
|
|
"optional": false
|
|
},
|
|
"property": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 337,
|
|
"end": 341,
|
|
"ctxt": 0
|
|
},
|
|
"value": "push",
|
|
"optional": false
|
|
}
|
|
},
|
|
"arguments": [
|
|
{
|
|
"spread": null,
|
|
"expression": {
|
|
"type": "NumericLiteral",
|
|
"span": {
|
|
"start": 342,
|
|
"end": 345,
|
|
"ctxt": 0
|
|
},
|
|
"value": 100.0,
|
|
"raw": "100"
|
|
}
|
|
}
|
|
],
|
|
"typeArguments": null
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"generator": false,
|
|
"async": false,
|
|
"typeParameters": null,
|
|
"returnType": null
|
|
},
|
|
{
|
|
"type": "FunctionDeclaration",
|
|
"identifier": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 360,
|
|
"end": 364,
|
|
"ctxt": 0
|
|
},
|
|
"value": "foo4",
|
|
"optional": false
|
|
},
|
|
"declare": false,
|
|
"params": [
|
|
{
|
|
"type": "Parameter",
|
|
"span": {
|
|
"start": 365,
|
|
"end": 394,
|
|
"ctxt": 0
|
|
},
|
|
"decorators": [],
|
|
"pat": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 365,
|
|
"end": 394,
|
|
"ctxt": 0
|
|
},
|
|
"value": "results",
|
|
"optional": false,
|
|
"typeAnnotation": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 372,
|
|
"end": 394,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsUnionType",
|
|
"span": {
|
|
"start": 374,
|
|
"end": 394,
|
|
"ctxt": 0
|
|
},
|
|
"types": [
|
|
{
|
|
"type": "TsArrayType",
|
|
"span": {
|
|
"start": 374,
|
|
"end": 382,
|
|
"ctxt": 0
|
|
},
|
|
"elemType": {
|
|
"type": "TsKeywordType",
|
|
"span": {
|
|
"start": 374,
|
|
"end": 380,
|
|
"ctxt": 0
|
|
},
|
|
"kind": "number"
|
|
}
|
|
},
|
|
{
|
|
"type": "TsKeywordType",
|
|
"span": {
|
|
"start": 385,
|
|
"end": 394,
|
|
"ctxt": 0
|
|
},
|
|
"kind": "undefined"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"decorators": [],
|
|
"span": {
|
|
"start": 351,
|
|
"end": 442,
|
|
"ctxt": 0
|
|
},
|
|
"body": {
|
|
"type": "BlockStatement",
|
|
"span": {
|
|
"start": 396,
|
|
"end": 442,
|
|
"ctxt": 0
|
|
},
|
|
"stmts": [
|
|
{
|
|
"type": "ExpressionStatement",
|
|
"span": {
|
|
"start": 402,
|
|
"end": 417,
|
|
"ctxt": 0
|
|
},
|
|
"expression": {
|
|
"type": "AssignmentExpression",
|
|
"span": {
|
|
"start": 402,
|
|
"end": 416,
|
|
"ctxt": 0
|
|
},
|
|
"operator": "??=",
|
|
"left": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 402,
|
|
"end": 409,
|
|
"ctxt": 0
|
|
},
|
|
"value": "results",
|
|
"optional": false,
|
|
"typeAnnotation": null
|
|
},
|
|
"right": {
|
|
"type": "ArrayExpression",
|
|
"span": {
|
|
"start": 414,
|
|
"end": 416,
|
|
"ctxt": 0
|
|
},
|
|
"elements": []
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"type": "ExpressionStatement",
|
|
"span": {
|
|
"start": 422,
|
|
"end": 440,
|
|
"ctxt": 0
|
|
},
|
|
"expression": {
|
|
"type": "CallExpression",
|
|
"span": {
|
|
"start": 422,
|
|
"end": 439,
|
|
"ctxt": 0
|
|
},
|
|
"callee": {
|
|
"type": "MemberExpression",
|
|
"span": {
|
|
"start": 422,
|
|
"end": 434,
|
|
"ctxt": 0
|
|
},
|
|
"object": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 422,
|
|
"end": 429,
|
|
"ctxt": 0
|
|
},
|
|
"value": "results",
|
|
"optional": false
|
|
},
|
|
"property": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 430,
|
|
"end": 434,
|
|
"ctxt": 0
|
|
},
|
|
"value": "push",
|
|
"optional": false
|
|
}
|
|
},
|
|
"arguments": [
|
|
{
|
|
"spread": null,
|
|
"expression": {
|
|
"type": "NumericLiteral",
|
|
"span": {
|
|
"start": 435,
|
|
"end": 438,
|
|
"ctxt": 0
|
|
},
|
|
"value": 100.0,
|
|
"raw": "100"
|
|
}
|
|
}
|
|
],
|
|
"typeArguments": null
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"generator": false,
|
|
"async": false,
|
|
"typeParameters": null,
|
|
"returnType": null
|
|
},
|
|
{
|
|
"type": "TsInterfaceDeclaration",
|
|
"span": {
|
|
"start": 444,
|
|
"end": 526,
|
|
"ctxt": 0
|
|
},
|
|
"id": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 454,
|
|
"end": 471,
|
|
"ctxt": 0
|
|
},
|
|
"value": "ThingWithOriginal",
|
|
"optional": false
|
|
},
|
|
"declare": false,
|
|
"typeParams": null,
|
|
"extends": [],
|
|
"body": {
|
|
"type": "TsInterfaceBody",
|
|
"span": {
|
|
"start": 472,
|
|
"end": 526,
|
|
"ctxt": 0
|
|
},
|
|
"body": [
|
|
{
|
|
"type": "TsPropertySignature",
|
|
"span": {
|
|
"start": 478,
|
|
"end": 491,
|
|
"ctxt": 0
|
|
},
|
|
"readonly": false,
|
|
"key": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 478,
|
|
"end": 482,
|
|
"ctxt": 0
|
|
},
|
|
"value": "name",
|
|
"optional": false
|
|
},
|
|
"computed": false,
|
|
"optional": false,
|
|
"init": null,
|
|
"params": [],
|
|
"typeAnnotation": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 482,
|
|
"end": 490,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsKeywordType",
|
|
"span": {
|
|
"start": 484,
|
|
"end": 490,
|
|
"ctxt": 0
|
|
},
|
|
"kind": "string"
|
|
}
|
|
},
|
|
"typeParams": null
|
|
},
|
|
{
|
|
"type": "TsPropertySignature",
|
|
"span": {
|
|
"start": 496,
|
|
"end": 524,
|
|
"ctxt": 0
|
|
},
|
|
"readonly": false,
|
|
"key": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 496,
|
|
"end": 504,
|
|
"ctxt": 0
|
|
},
|
|
"value": "original",
|
|
"optional": false
|
|
},
|
|
"computed": false,
|
|
"optional": true,
|
|
"init": null,
|
|
"params": [],
|
|
"typeAnnotation": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 505,
|
|
"end": 524,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsTypeReference",
|
|
"span": {
|
|
"start": 507,
|
|
"end": 524,
|
|
"ctxt": 0
|
|
},
|
|
"typeName": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 507,
|
|
"end": 524,
|
|
"ctxt": 0
|
|
},
|
|
"value": "ThingWithOriginal",
|
|
"optional": false
|
|
},
|
|
"typeParams": null
|
|
}
|
|
},
|
|
"typeParams": null
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "VariableDeclaration",
|
|
"span": {
|
|
"start": 527,
|
|
"end": 550,
|
|
"ctxt": 0
|
|
},
|
|
"kind": "const",
|
|
"declare": true,
|
|
"declarations": [
|
|
{
|
|
"type": "VariableDeclarator",
|
|
"span": {
|
|
"start": 541,
|
|
"end": 550,
|
|
"ctxt": 0
|
|
},
|
|
"id": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 541,
|
|
"end": 542,
|
|
"ctxt": 0
|
|
},
|
|
"value": "v",
|
|
"optional": false,
|
|
"typeAnnotation": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 542,
|
|
"end": 550,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsKeywordType",
|
|
"span": {
|
|
"start": 544,
|
|
"end": 550,
|
|
"ctxt": 0
|
|
},
|
|
"kind": "number"
|
|
}
|
|
}
|
|
},
|
|
"init": null,
|
|
"definite": false
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "FunctionDeclaration",
|
|
"identifier": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 560,
|
|
"end": 580,
|
|
"ctxt": 0
|
|
},
|
|
"value": "doSomethingWithAlias",
|
|
"optional": false
|
|
},
|
|
"declare": false,
|
|
"params": [
|
|
{
|
|
"type": "Parameter",
|
|
"span": {
|
|
"start": 581,
|
|
"end": 617,
|
|
"ctxt": 0
|
|
},
|
|
"decorators": [],
|
|
"pat": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 581,
|
|
"end": 617,
|
|
"ctxt": 0
|
|
},
|
|
"value": "thing",
|
|
"optional": false,
|
|
"typeAnnotation": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 586,
|
|
"end": 617,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsUnionType",
|
|
"span": {
|
|
"start": 588,
|
|
"end": 617,
|
|
"ctxt": 0
|
|
},
|
|
"types": [
|
|
{
|
|
"type": "TsTypeReference",
|
|
"span": {
|
|
"start": 588,
|
|
"end": 605,
|
|
"ctxt": 0
|
|
},
|
|
"typeName": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 588,
|
|
"end": 605,
|
|
"ctxt": 0
|
|
},
|
|
"value": "ThingWithOriginal",
|
|
"optional": false
|
|
},
|
|
"typeParams": null
|
|
},
|
|
{
|
|
"type": "TsKeywordType",
|
|
"span": {
|
|
"start": 608,
|
|
"end": 617,
|
|
"ctxt": 0
|
|
},
|
|
"kind": "undefined"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"type": "Parameter",
|
|
"span": {
|
|
"start": 619,
|
|
"end": 662,
|
|
"ctxt": 0
|
|
},
|
|
"decorators": [],
|
|
"pat": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 619,
|
|
"end": 662,
|
|
"ctxt": 0
|
|
},
|
|
"value": "defaultValue",
|
|
"optional": false,
|
|
"typeAnnotation": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 631,
|
|
"end": 662,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsUnionType",
|
|
"span": {
|
|
"start": 633,
|
|
"end": 662,
|
|
"ctxt": 0
|
|
},
|
|
"types": [
|
|
{
|
|
"type": "TsTypeReference",
|
|
"span": {
|
|
"start": 633,
|
|
"end": 650,
|
|
"ctxt": 0
|
|
},
|
|
"typeName": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 633,
|
|
"end": 650,
|
|
"ctxt": 0
|
|
},
|
|
"value": "ThingWithOriginal",
|
|
"optional": false
|
|
},
|
|
"typeParams": null
|
|
},
|
|
{
|
|
"type": "TsKeywordType",
|
|
"span": {
|
|
"start": 653,
|
|
"end": 662,
|
|
"ctxt": 0
|
|
},
|
|
"kind": "undefined"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"decorators": [],
|
|
"span": {
|
|
"start": 551,
|
|
"end": 1151,
|
|
"ctxt": 0
|
|
},
|
|
"body": {
|
|
"type": "BlockStatement",
|
|
"span": {
|
|
"start": 664,
|
|
"end": 1151,
|
|
"ctxt": 0
|
|
},
|
|
"stmts": [
|
|
{
|
|
"type": "IfStatement",
|
|
"span": {
|
|
"start": 670,
|
|
"end": 1149,
|
|
"ctxt": 0
|
|
},
|
|
"test": {
|
|
"type": "BinaryExpression",
|
|
"span": {
|
|
"start": 674,
|
|
"end": 681,
|
|
"ctxt": 0
|
|
},
|
|
"operator": "===",
|
|
"left": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 674,
|
|
"end": 675,
|
|
"ctxt": 0
|
|
},
|
|
"value": "v",
|
|
"optional": false
|
|
},
|
|
"right": {
|
|
"type": "NumericLiteral",
|
|
"span": {
|
|
"start": 680,
|
|
"end": 681,
|
|
"ctxt": 0
|
|
},
|
|
"value": 1.0,
|
|
"raw": "1"
|
|
}
|
|
},
|
|
"consequent": {
|
|
"type": "BlockStatement",
|
|
"span": {
|
|
"start": 683,
|
|
"end": 764,
|
|
"ctxt": 0
|
|
},
|
|
"stmts": [
|
|
{
|
|
"type": "IfStatement",
|
|
"span": {
|
|
"start": 693,
|
|
"end": 758,
|
|
"ctxt": 0
|
|
},
|
|
"test": {
|
|
"type": "AssignmentExpression",
|
|
"span": {
|
|
"start": 697,
|
|
"end": 721,
|
|
"ctxt": 0
|
|
},
|
|
"operator": "&&=",
|
|
"left": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 697,
|
|
"end": 702,
|
|
"ctxt": 0
|
|
},
|
|
"value": "thing",
|
|
"optional": false,
|
|
"typeAnnotation": null
|
|
},
|
|
"right": {
|
|
"type": "MemberExpression",
|
|
"span": {
|
|
"start": 707,
|
|
"end": 721,
|
|
"ctxt": 0
|
|
},
|
|
"object": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 707,
|
|
"end": 712,
|
|
"ctxt": 0
|
|
},
|
|
"value": "thing",
|
|
"optional": false
|
|
},
|
|
"property": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 713,
|
|
"end": 721,
|
|
"ctxt": 0
|
|
},
|
|
"value": "original",
|
|
"optional": false
|
|
}
|
|
}
|
|
},
|
|
"consequent": {
|
|
"type": "BlockStatement",
|
|
"span": {
|
|
"start": 723,
|
|
"end": 758,
|
|
"ctxt": 0
|
|
},
|
|
"stmts": [
|
|
{
|
|
"type": "ExpressionStatement",
|
|
"span": {
|
|
"start": 737,
|
|
"end": 748,
|
|
"ctxt": 0
|
|
},
|
|
"expression": {
|
|
"type": "MemberExpression",
|
|
"span": {
|
|
"start": 737,
|
|
"end": 747,
|
|
"ctxt": 0
|
|
},
|
|
"object": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 737,
|
|
"end": 742,
|
|
"ctxt": 0
|
|
},
|
|
"value": "thing",
|
|
"optional": false
|
|
},
|
|
"property": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 743,
|
|
"end": 747,
|
|
"ctxt": 0
|
|
},
|
|
"value": "name",
|
|
"optional": false
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"alternate": null
|
|
}
|
|
]
|
|
},
|
|
"alternate": {
|
|
"type": "IfStatement",
|
|
"span": {
|
|
"start": 774,
|
|
"end": 1149,
|
|
"ctxt": 0
|
|
},
|
|
"test": {
|
|
"type": "BinaryExpression",
|
|
"span": {
|
|
"start": 778,
|
|
"end": 785,
|
|
"ctxt": 0
|
|
},
|
|
"operator": "===",
|
|
"left": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 778,
|
|
"end": 779,
|
|
"ctxt": 0
|
|
},
|
|
"value": "v",
|
|
"optional": false
|
|
},
|
|
"right": {
|
|
"type": "NumericLiteral",
|
|
"span": {
|
|
"start": 784,
|
|
"end": 785,
|
|
"ctxt": 0
|
|
},
|
|
"value": 2.0,
|
|
"raw": "2"
|
|
}
|
|
},
|
|
"consequent": {
|
|
"type": "BlockStatement",
|
|
"span": {
|
|
"start": 787,
|
|
"end": 896,
|
|
"ctxt": 0
|
|
},
|
|
"stmts": [
|
|
{
|
|
"type": "IfStatement",
|
|
"span": {
|
|
"start": 797,
|
|
"end": 890,
|
|
"ctxt": 0
|
|
},
|
|
"test": {
|
|
"type": "AssignmentExpression",
|
|
"span": {
|
|
"start": 801,
|
|
"end": 823,
|
|
"ctxt": 0
|
|
},
|
|
"operator": "&&=",
|
|
"left": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 801,
|
|
"end": 806,
|
|
"ctxt": 0
|
|
},
|
|
"value": "thing",
|
|
"optional": false,
|
|
"typeAnnotation": null
|
|
},
|
|
"right": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 811,
|
|
"end": 823,
|
|
"ctxt": 0
|
|
},
|
|
"value": "defaultValue",
|
|
"optional": false
|
|
}
|
|
},
|
|
"consequent": {
|
|
"type": "BlockStatement",
|
|
"span": {
|
|
"start": 825,
|
|
"end": 890,
|
|
"ctxt": 0
|
|
},
|
|
"stmts": [
|
|
{
|
|
"type": "ExpressionStatement",
|
|
"span": {
|
|
"start": 839,
|
|
"end": 850,
|
|
"ctxt": 0
|
|
},
|
|
"expression": {
|
|
"type": "MemberExpression",
|
|
"span": {
|
|
"start": 839,
|
|
"end": 849,
|
|
"ctxt": 0
|
|
},
|
|
"object": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 839,
|
|
"end": 844,
|
|
"ctxt": 0
|
|
},
|
|
"value": "thing",
|
|
"optional": false
|
|
},
|
|
"property": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 845,
|
|
"end": 849,
|
|
"ctxt": 0
|
|
},
|
|
"value": "name",
|
|
"optional": false
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"type": "ExpressionStatement",
|
|
"span": {
|
|
"start": 863,
|
|
"end": 880,
|
|
"ctxt": 0
|
|
},
|
|
"expression": {
|
|
"type": "MemberExpression",
|
|
"span": {
|
|
"start": 863,
|
|
"end": 880,
|
|
"ctxt": 0
|
|
},
|
|
"object": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 863,
|
|
"end": 875,
|
|
"ctxt": 0
|
|
},
|
|
"value": "defaultValue",
|
|
"optional": false
|
|
},
|
|
"property": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 876,
|
|
"end": 880,
|
|
"ctxt": 0
|
|
},
|
|
"value": "name",
|
|
"optional": false
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"alternate": null
|
|
}
|
|
]
|
|
},
|
|
"alternate": {
|
|
"type": "IfStatement",
|
|
"span": {
|
|
"start": 906,
|
|
"end": 1149,
|
|
"ctxt": 0
|
|
},
|
|
"test": {
|
|
"type": "BinaryExpression",
|
|
"span": {
|
|
"start": 910,
|
|
"end": 917,
|
|
"ctxt": 0
|
|
},
|
|
"operator": "===",
|
|
"left": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 910,
|
|
"end": 911,
|
|
"ctxt": 0
|
|
},
|
|
"value": "v",
|
|
"optional": false
|
|
},
|
|
"right": {
|
|
"type": "NumericLiteral",
|
|
"span": {
|
|
"start": 916,
|
|
"end": 917,
|
|
"ctxt": 0
|
|
},
|
|
"value": 3.0,
|
|
"raw": "3"
|
|
}
|
|
},
|
|
"consequent": {
|
|
"type": "BlockStatement",
|
|
"span": {
|
|
"start": 919,
|
|
"end": 1029,
|
|
"ctxt": 0
|
|
},
|
|
"stmts": [
|
|
{
|
|
"type": "IfStatement",
|
|
"span": {
|
|
"start": 929,
|
|
"end": 1023,
|
|
"ctxt": 0
|
|
},
|
|
"test": {
|
|
"type": "AssignmentExpression",
|
|
"span": {
|
|
"start": 933,
|
|
"end": 955,
|
|
"ctxt": 0
|
|
},
|
|
"operator": "||=",
|
|
"left": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 933,
|
|
"end": 938,
|
|
"ctxt": 0
|
|
},
|
|
"value": "thing",
|
|
"optional": false,
|
|
"typeAnnotation": null
|
|
},
|
|
"right": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 943,
|
|
"end": 955,
|
|
"ctxt": 0
|
|
},
|
|
"value": "defaultValue",
|
|
"optional": false
|
|
}
|
|
},
|
|
"consequent": {
|
|
"type": "BlockStatement",
|
|
"span": {
|
|
"start": 957,
|
|
"end": 1023,
|
|
"ctxt": 0
|
|
},
|
|
"stmts": [
|
|
{
|
|
"type": "ExpressionStatement",
|
|
"span": {
|
|
"start": 971,
|
|
"end": 982,
|
|
"ctxt": 0
|
|
},
|
|
"expression": {
|
|
"type": "MemberExpression",
|
|
"span": {
|
|
"start": 971,
|
|
"end": 981,
|
|
"ctxt": 0
|
|
},
|
|
"object": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 971,
|
|
"end": 976,
|
|
"ctxt": 0
|
|
},
|
|
"value": "thing",
|
|
"optional": false
|
|
},
|
|
"property": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 977,
|
|
"end": 981,
|
|
"ctxt": 0
|
|
},
|
|
"value": "name",
|
|
"optional": false
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"type": "ExpressionStatement",
|
|
"span": {
|
|
"start": 995,
|
|
"end": 1013,
|
|
"ctxt": 0
|
|
},
|
|
"expression": {
|
|
"type": "MemberExpression",
|
|
"span": {
|
|
"start": 995,
|
|
"end": 1012,
|
|
"ctxt": 0
|
|
},
|
|
"object": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 995,
|
|
"end": 1007,
|
|
"ctxt": 0
|
|
},
|
|
"value": "defaultValue",
|
|
"optional": false
|
|
},
|
|
"property": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1008,
|
|
"end": 1012,
|
|
"ctxt": 0
|
|
},
|
|
"value": "name",
|
|
"optional": false
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"alternate": null
|
|
}
|
|
]
|
|
},
|
|
"alternate": {
|
|
"type": "BlockStatement",
|
|
"span": {
|
|
"start": 1039,
|
|
"end": 1149,
|
|
"ctxt": 0
|
|
},
|
|
"stmts": [
|
|
{
|
|
"type": "IfStatement",
|
|
"span": {
|
|
"start": 1049,
|
|
"end": 1143,
|
|
"ctxt": 0
|
|
},
|
|
"test": {
|
|
"type": "AssignmentExpression",
|
|
"span": {
|
|
"start": 1053,
|
|
"end": 1075,
|
|
"ctxt": 0
|
|
},
|
|
"operator": "??=",
|
|
"left": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1053,
|
|
"end": 1058,
|
|
"ctxt": 0
|
|
},
|
|
"value": "thing",
|
|
"optional": false,
|
|
"typeAnnotation": null
|
|
},
|
|
"right": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1063,
|
|
"end": 1075,
|
|
"ctxt": 0
|
|
},
|
|
"value": "defaultValue",
|
|
"optional": false
|
|
}
|
|
},
|
|
"consequent": {
|
|
"type": "BlockStatement",
|
|
"span": {
|
|
"start": 1077,
|
|
"end": 1143,
|
|
"ctxt": 0
|
|
},
|
|
"stmts": [
|
|
{
|
|
"type": "ExpressionStatement",
|
|
"span": {
|
|
"start": 1091,
|
|
"end": 1102,
|
|
"ctxt": 0
|
|
},
|
|
"expression": {
|
|
"type": "MemberExpression",
|
|
"span": {
|
|
"start": 1091,
|
|
"end": 1101,
|
|
"ctxt": 0
|
|
},
|
|
"object": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1091,
|
|
"end": 1096,
|
|
"ctxt": 0
|
|
},
|
|
"value": "thing",
|
|
"optional": false
|
|
},
|
|
"property": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1097,
|
|
"end": 1101,
|
|
"ctxt": 0
|
|
},
|
|
"value": "name",
|
|
"optional": false
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"type": "ExpressionStatement",
|
|
"span": {
|
|
"start": 1115,
|
|
"end": 1133,
|
|
"ctxt": 0
|
|
},
|
|
"expression": {
|
|
"type": "MemberExpression",
|
|
"span": {
|
|
"start": 1115,
|
|
"end": 1132,
|
|
"ctxt": 0
|
|
},
|
|
"object": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1115,
|
|
"end": 1127,
|
|
"ctxt": 0
|
|
},
|
|
"value": "defaultValue",
|
|
"optional": false
|
|
},
|
|
"property": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1128,
|
|
"end": 1132,
|
|
"ctxt": 0
|
|
},
|
|
"value": "name",
|
|
"optional": false
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"alternate": null
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"generator": false,
|
|
"async": false,
|
|
"typeParameters": null,
|
|
"returnType": null
|
|
}
|
|
],
|
|
"interpreter": null
|
|
}
|