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

3147 lines
83 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 28,
"end": 1514,
"ctxt": 0
},
"body": [
{
"type": "TsTypeAliasDeclaration",
"span": {
"start": 28,
"end": 69,
"ctxt": 0
},
"declare": false,
"id": {
"type": "Identifier",
"span": {
"start": 33,
"end": 34,
"ctxt": 0
},
"value": "A",
"optional": false
},
"typeParams": null,
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 37,
"end": 69,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 41,
"end": 51,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 41,
"end": 45,
"ctxt": 0
},
"value": "type",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 45,
"end": 50,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsLiteralType",
"span": {
"start": 47,
"end": 50,
"ctxt": 0
},
"literal": {
"type": "StringLiteral",
"span": {
"start": 47,
"end": 50,
"ctxt": 0
},
"value": "A",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
},
"typeParams": null
},
{
"type": "TsPropertySignature",
"span": {
"start": 54,
"end": 67,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 54,
"end": 58,
"ctxt": 0
},
"value": "name",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 58,
"end": 66,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 60,
"end": 66,
"ctxt": 0
},
"kind": "string"
}
},
"typeParams": null
}
]
}
},
{
"type": "TsTypeAliasDeclaration",
"span": {
"start": 71,
"end": 96,
"ctxt": 0
},
"declare": false,
"id": {
"type": "Identifier",
"span": {
"start": 76,
"end": 77,
"ctxt": 0
},
"value": "B",
"optional": false
},
"typeParams": null,
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 80,
"end": 96,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 84,
"end": 94,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 84,
"end": 88,
"ctxt": 0
},
"value": "type",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 88,
"end": 93,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsLiteralType",
"span": {
"start": 90,
"end": 93,
"ctxt": 0
},
"literal": {
"type": "StringLiteral",
"span": {
"start": 90,
"end": 93,
"ctxt": 0
},
"value": "B",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
},
"typeParams": null
}
]
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 107,
"end": 114,
"ctxt": 0
},
"value": "funcTwo",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 115,
"end": 137,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 115,
"end": 137,
"ctxt": 0
},
"value": "arg",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 118,
"end": 137,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 120,
"end": 137,
"ctxt": 0
},
"types": [
{
"type": "TsTypeReference",
"span": {
"start": 120,
"end": 121,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 120,
"end": 121,
"ctxt": 0
},
"value": "A",
"optional": false
},
"typeParams": null
},
{
"type": "TsTypeReference",
"span": {
"start": 124,
"end": 125,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 124,
"end": 125,
"ctxt": 0
},
"value": "B",
"optional": false
},
"typeParams": null
},
{
"type": "TsKeywordType",
"span": {
"start": 128,
"end": 137,
"ctxt": 0
},
"kind": "undefined"
}
]
}
}
}
}
],
"decorators": [],
"span": {
"start": 98,
"end": 222,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 139,
"end": 222,
"ctxt": 0
},
"stmts": [
{
"type": "IfStatement",
"span": {
"start": 143,
"end": 199,
"ctxt": 0
},
"test": {
"type": "BinaryExpression",
"span": {
"start": 147,
"end": 164,
"ctxt": 0
},
"operator": "===",
"left": {
"type": "OptionalChainingExpression",
"span": {
"start": 147,
"end": 156,
"ctxt": 0
},
"questionDotToken": {
"start": 150,
"end": 151,
"ctxt": 0
},
"base": {
"type": "MemberExpression",
"span": {
"start": 147,
"end": 156,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 147,
"end": 150,
"ctxt": 0
},
"value": "arg",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 152,
"end": 156,
"ctxt": 0
},
"value": "type",
"optional": false
}
}
},
"right": {
"type": "StringLiteral",
"span": {
"start": 161,
"end": 164,
"ctxt": 0
},
"value": "B",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
},
"consequent": {
"type": "BlockStatement",
"span": {
"start": 166,
"end": 199,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 172,
"end": 176,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 172,
"end": 175,
"ctxt": 0
},
"value": "arg",
"optional": false
}
},
{
"type": "ReturnStatement",
"span": {
"start": 188,
"end": 195,
"ctxt": 0
},
"argument": null
}
]
},
"alternate": null
},
{
"type": "ExpressionStatement",
"span": {
"start": 203,
"end": 207,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 203,
"end": 206,
"ctxt": 0
},
"value": "arg",
"optional": false
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 210,
"end": 220,
"ctxt": 0
},
"expression": {
"type": "OptionalChainingExpression",
"span": {
"start": 210,
"end": 219,
"ctxt": 0
},
"questionDotToken": {
"start": 213,
"end": 214,
"ctxt": 0
},
"base": {
"type": "MemberExpression",
"span": {
"start": 210,
"end": 219,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 210,
"end": 213,
"ctxt": 0
},
"value": "arg",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 215,
"end": 219,
"ctxt": 0
},
"value": "name",
"optional": false
}
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 233,
"end": 242,
"ctxt": 0
},
"value": "funcThree",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 243,
"end": 260,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 243,
"end": 260,
"ctxt": 0
},
"value": "arg",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 246,
"end": 260,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 248,
"end": 260,
"ctxt": 0
},
"types": [
{
"type": "TsTypeReference",
"span": {
"start": 248,
"end": 249,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 248,
"end": 249,
"ctxt": 0
},
"value": "A",
"optional": false
},
"typeParams": null
},
{
"type": "TsTypeReference",
"span": {
"start": 252,
"end": 253,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 252,
"end": 253,
"ctxt": 0
},
"value": "B",
"optional": false
},
"typeParams": null
},
{
"type": "TsKeywordType",
"span": {
"start": 256,
"end": 260,
"ctxt": 0
},
"kind": "null"
}
]
}
}
}
}
],
"decorators": [],
"span": {
"start": 224,
"end": 345,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 262,
"end": 345,
"ctxt": 0
},
"stmts": [
{
"type": "IfStatement",
"span": {
"start": 266,
"end": 322,
"ctxt": 0
},
"test": {
"type": "BinaryExpression",
"span": {
"start": 270,
"end": 287,
"ctxt": 0
},
"operator": "===",
"left": {
"type": "OptionalChainingExpression",
"span": {
"start": 270,
"end": 279,
"ctxt": 0
},
"questionDotToken": {
"start": 273,
"end": 274,
"ctxt": 0
},
"base": {
"type": "MemberExpression",
"span": {
"start": 270,
"end": 279,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 270,
"end": 273,
"ctxt": 0
},
"value": "arg",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 275,
"end": 279,
"ctxt": 0
},
"value": "type",
"optional": false
}
}
},
"right": {
"type": "StringLiteral",
"span": {
"start": 284,
"end": 287,
"ctxt": 0
},
"value": "B",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
},
"consequent": {
"type": "BlockStatement",
"span": {
"start": 289,
"end": 322,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 295,
"end": 299,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 295,
"end": 298,
"ctxt": 0
},
"value": "arg",
"optional": false
}
},
{
"type": "ReturnStatement",
"span": {
"start": 311,
"end": 318,
"ctxt": 0
},
"argument": null
}
]
},
"alternate": null
},
{
"type": "ExpressionStatement",
"span": {
"start": 326,
"end": 330,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 326,
"end": 329,
"ctxt": 0
},
"value": "arg",
"optional": false
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 333,
"end": 343,
"ctxt": 0
},
"expression": {
"type": "OptionalChainingExpression",
"span": {
"start": 333,
"end": 342,
"ctxt": 0
},
"questionDotToken": {
"start": 336,
"end": 337,
"ctxt": 0
},
"base": {
"type": "MemberExpression",
"span": {
"start": 333,
"end": 342,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 333,
"end": 336,
"ctxt": 0
},
"value": "arg",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 338,
"end": 342,
"ctxt": 0
},
"value": "name",
"optional": false
}
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "TsTypeAliasDeclaration",
"span": {
"start": 347,
"end": 383,
"ctxt": 0
},
"declare": false,
"id": {
"type": "Identifier",
"span": {
"start": 352,
"end": 353,
"ctxt": 0
},
"value": "U",
"optional": false
},
"typeParams": null,
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 356,
"end": 383,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 358,
"end": 374,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 358,
"end": 362,
"ctxt": 0
},
"value": "kind",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 362,
"end": 373,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 364,
"end": 373,
"ctxt": 0
},
"kind": "undefined"
}
},
"typeParams": null
},
{
"type": "TsPropertySignature",
"span": {
"start": 375,
"end": 381,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 375,
"end": 376,
"ctxt": 0
},
"value": "u",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 376,
"end": 381,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsLiteralType",
"span": {
"start": 378,
"end": 381,
"ctxt": 0
},
"literal": {
"type": "StringLiteral",
"span": {
"start": 378,
"end": 381,
"ctxt": 0
},
"value": "u",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
},
"typeParams": null
}
]
}
},
{
"type": "TsTypeAliasDeclaration",
"span": {
"start": 384,
"end": 415,
"ctxt": 0
},
"declare": false,
"id": {
"type": "Identifier",
"span": {
"start": 389,
"end": 390,
"ctxt": 0
},
"value": "N",
"optional": false
},
"typeParams": null,
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 393,
"end": 415,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 395,
"end": 406,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 395,
"end": 399,
"ctxt": 0
},
"value": "kind",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 399,
"end": 405,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 401,
"end": 405,
"ctxt": 0
},
"kind": "null"
}
},
"typeParams": null
},
{
"type": "TsPropertySignature",
"span": {
"start": 407,
"end": 413,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 407,
"end": 408,
"ctxt": 0
},
"value": "n",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 408,
"end": 413,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsLiteralType",
"span": {
"start": 410,
"end": 413,
"ctxt": 0
},
"literal": {
"type": "StringLiteral",
"span": {
"start": 410,
"end": 413,
"ctxt": 0
},
"value": "n",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
},
"typeParams": null
}
]
}
},
{
"type": "TsTypeAliasDeclaration",
"span": {
"start": 416,
"end": 446,
"ctxt": 0
},
"declare": false,
"id": {
"type": "Identifier",
"span": {
"start": 421,
"end": 422,
"ctxt": 0
},
"value": "X",
"optional": false
},
"typeParams": null,
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 425,
"end": 446,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 427,
"end": 437,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 427,
"end": 431,
"ctxt": 0
},
"value": "kind",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 431,
"end": 436,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsLiteralType",
"span": {
"start": 433,
"end": 436,
"ctxt": 0
},
"literal": {
"type": "StringLiteral",
"span": {
"start": 433,
"end": 436,
"ctxt": 0
},
"value": "X",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
},
"typeParams": null
},
{
"type": "TsPropertySignature",
"span": {
"start": 438,
"end": 444,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 438,
"end": 439,
"ctxt": 0
},
"value": "x",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 439,
"end": 444,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsLiteralType",
"span": {
"start": 441,
"end": 444,
"ctxt": 0
},
"literal": {
"type": "StringLiteral",
"span": {
"start": 441,
"end": 444,
"ctxt": 0
},
"value": "x",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
},
"typeParams": null
}
]
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 457,
"end": 459,
"ctxt": 0
},
"value": "f1",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 460,
"end": 480,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 460,
"end": 480,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 461,
"end": 480,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 463,
"end": 480,
"ctxt": 0
},
"types": [
{
"type": "TsTypeReference",
"span": {
"start": 463,
"end": 464,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 463,
"end": 464,
"ctxt": 0
},
"value": "X",
"optional": false
},
"typeParams": null
},
{
"type": "TsTypeReference",
"span": {
"start": 467,
"end": 468,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 467,
"end": 468,
"ctxt": 0
},
"value": "U",
"optional": false
},
"typeParams": null
},
{
"type": "TsKeywordType",
"span": {
"start": 471,
"end": 480,
"ctxt": 0
},
"kind": "undefined"
}
]
}
}
}
}
],
"decorators": [],
"span": {
"start": 448,
"end": 585,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 482,
"end": 585,
"ctxt": 0
},
"stmts": [
{
"type": "IfStatement",
"span": {
"start": 488,
"end": 583,
"ctxt": 0
},
"test": {
"type": "BinaryExpression",
"span": {
"start": 492,
"end": 513,
"ctxt": 0
},
"operator": "===",
"left": {
"type": "OptionalChainingExpression",
"span": {
"start": 492,
"end": 499,
"ctxt": 0
},
"questionDotToken": {
"start": 493,
"end": 494,
"ctxt": 0
},
"base": {
"type": "MemberExpression",
"span": {
"start": 492,
"end": 499,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 492,
"end": 493,
"ctxt": 0
},
"value": "x",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 495,
"end": 499,
"ctxt": 0
},
"value": "kind",
"optional": false
}
}
},
"right": {
"type": "Identifier",
"span": {
"start": 504,
"end": 513,
"ctxt": 0
},
"value": "undefined",
"optional": false
}
},
"consequent": {
"type": "BlockStatement",
"span": {
"start": 515,
"end": 550,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 525,
"end": 527,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 525,
"end": 526,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
]
},
"alternate": {
"type": "BlockStatement",
"span": {
"start": 560,
"end": 583,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 570,
"end": 572,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 570,
"end": 571,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
]
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 596,
"end": 598,
"ctxt": 0
},
"value": "f2",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 599,
"end": 619,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 599,
"end": 619,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 600,
"end": 619,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 602,
"end": 619,
"ctxt": 0
},
"types": [
{
"type": "TsTypeReference",
"span": {
"start": 602,
"end": 603,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 602,
"end": 603,
"ctxt": 0
},
"value": "X",
"optional": false
},
"typeParams": null
},
{
"type": "TsTypeReference",
"span": {
"start": 606,
"end": 607,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 606,
"end": 607,
"ctxt": 0
},
"value": "N",
"optional": false
},
"typeParams": null
},
{
"type": "TsKeywordType",
"span": {
"start": 610,
"end": 619,
"ctxt": 0
},
"kind": "undefined"
}
]
}
}
}
}
],
"decorators": [],
"span": {
"start": 587,
"end": 724,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 621,
"end": 724,
"ctxt": 0
},
"stmts": [
{
"type": "IfStatement",
"span": {
"start": 627,
"end": 722,
"ctxt": 0
},
"test": {
"type": "BinaryExpression",
"span": {
"start": 631,
"end": 652,
"ctxt": 0
},
"operator": "===",
"left": {
"type": "OptionalChainingExpression",
"span": {
"start": 631,
"end": 638,
"ctxt": 0
},
"questionDotToken": {
"start": 632,
"end": 633,
"ctxt": 0
},
"base": {
"type": "MemberExpression",
"span": {
"start": 631,
"end": 638,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 631,
"end": 632,
"ctxt": 0
},
"value": "x",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 634,
"end": 638,
"ctxt": 0
},
"value": "kind",
"optional": false
}
}
},
"right": {
"type": "Identifier",
"span": {
"start": 643,
"end": 652,
"ctxt": 0
},
"value": "undefined",
"optional": false
}
},
"consequent": {
"type": "BlockStatement",
"span": {
"start": 654,
"end": 685,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 664,
"end": 666,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 664,
"end": 665,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
]
},
"alternate": {
"type": "BlockStatement",
"span": {
"start": 695,
"end": 722,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 705,
"end": 707,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 705,
"end": 706,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
]
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 735,
"end": 737,
"ctxt": 0
},
"value": "f3",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 738,
"end": 753,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 738,
"end": 753,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 739,
"end": 753,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 741,
"end": 753,
"ctxt": 0
},
"types": [
{
"type": "TsTypeReference",
"span": {
"start": 741,
"end": 742,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 741,
"end": 742,
"ctxt": 0
},
"value": "X",
"optional": false
},
"typeParams": null
},
{
"type": "TsTypeReference",
"span": {
"start": 745,
"end": 746,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 745,
"end": 746,
"ctxt": 0
},
"value": "U",
"optional": false
},
"typeParams": null
},
{
"type": "TsKeywordType",
"span": {
"start": 749,
"end": 753,
"ctxt": 0
},
"kind": "null"
}
]
}
}
}
}
],
"decorators": [],
"span": {
"start": 726,
"end": 853,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 755,
"end": 853,
"ctxt": 0
},
"stmts": [
{
"type": "IfStatement",
"span": {
"start": 761,
"end": 851,
"ctxt": 0
},
"test": {
"type": "BinaryExpression",
"span": {
"start": 765,
"end": 786,
"ctxt": 0
},
"operator": "===",
"left": {
"type": "OptionalChainingExpression",
"span": {
"start": 765,
"end": 772,
"ctxt": 0
},
"questionDotToken": {
"start": 766,
"end": 767,
"ctxt": 0
},
"base": {
"type": "MemberExpression",
"span": {
"start": 765,
"end": 772,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 765,
"end": 766,
"ctxt": 0
},
"value": "x",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 768,
"end": 772,
"ctxt": 0
},
"value": "kind",
"optional": false
}
}
},
"right": {
"type": "Identifier",
"span": {
"start": 777,
"end": 786,
"ctxt": 0
},
"value": "undefined",
"optional": false
}
},
"consequent": {
"type": "BlockStatement",
"span": {
"start": 788,
"end": 818,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 798,
"end": 800,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 798,
"end": 799,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
]
},
"alternate": {
"type": "BlockStatement",
"span": {
"start": 828,
"end": 851,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 838,
"end": 840,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 838,
"end": 839,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
]
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 864,
"end": 866,
"ctxt": 0
},
"value": "f4",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 867,
"end": 882,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 867,
"end": 882,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 868,
"end": 882,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 870,
"end": 882,
"ctxt": 0
},
"types": [
{
"type": "TsTypeReference",
"span": {
"start": 870,
"end": 871,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 870,
"end": 871,
"ctxt": 0
},
"value": "X",
"optional": false
},
"typeParams": null
},
{
"type": "TsTypeReference",
"span": {
"start": 874,
"end": 875,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 874,
"end": 875,
"ctxt": 0
},
"value": "N",
"optional": false
},
"typeParams": null
},
{
"type": "TsKeywordType",
"span": {
"start": 878,
"end": 882,
"ctxt": 0
},
"kind": "null"
}
]
}
}
}
}
],
"decorators": [],
"span": {
"start": 855,
"end": 982,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 884,
"end": 982,
"ctxt": 0
},
"stmts": [
{
"type": "IfStatement",
"span": {
"start": 890,
"end": 980,
"ctxt": 0
},
"test": {
"type": "BinaryExpression",
"span": {
"start": 894,
"end": 915,
"ctxt": 0
},
"operator": "===",
"left": {
"type": "OptionalChainingExpression",
"span": {
"start": 894,
"end": 901,
"ctxt": 0
},
"questionDotToken": {
"start": 895,
"end": 896,
"ctxt": 0
},
"base": {
"type": "MemberExpression",
"span": {
"start": 894,
"end": 901,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 894,
"end": 895,
"ctxt": 0
},
"value": "x",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 897,
"end": 901,
"ctxt": 0
},
"value": "kind",
"optional": false
}
}
},
"right": {
"type": "Identifier",
"span": {
"start": 906,
"end": 915,
"ctxt": 0
},
"value": "undefined",
"optional": false
}
},
"consequent": {
"type": "BlockStatement",
"span": {
"start": 917,
"end": 943,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 927,
"end": 929,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 927,
"end": 928,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
]
},
"alternate": {
"type": "BlockStatement",
"span": {
"start": 953,
"end": 980,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 963,
"end": 965,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 963,
"end": 964,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
]
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 993,
"end": 995,
"ctxt": 0
},
"value": "f5",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 996,
"end": 1016,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 996,
"end": 1016,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 997,
"end": 1016,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 999,
"end": 1016,
"ctxt": 0
},
"types": [
{
"type": "TsTypeReference",
"span": {
"start": 999,
"end": 1000,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 999,
"end": 1000,
"ctxt": 0
},
"value": "X",
"optional": false
},
"typeParams": null
},
{
"type": "TsTypeReference",
"span": {
"start": 1003,
"end": 1004,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1003,
"end": 1004,
"ctxt": 0
},
"value": "U",
"optional": false
},
"typeParams": null
},
{
"type": "TsKeywordType",
"span": {
"start": 1007,
"end": 1016,
"ctxt": 0
},
"kind": "undefined"
}
]
}
}
}
}
],
"decorators": [],
"span": {
"start": 984,
"end": 1124,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 1018,
"end": 1124,
"ctxt": 0
},
"stmts": [
{
"type": "IfStatement",
"span": {
"start": 1024,
"end": 1122,
"ctxt": 0
},
"test": {
"type": "BinaryExpression",
"span": {
"start": 1028,
"end": 1044,
"ctxt": 0
},
"operator": "===",
"left": {
"type": "OptionalChainingExpression",
"span": {
"start": 1028,
"end": 1035,
"ctxt": 0
},
"questionDotToken": {
"start": 1029,
"end": 1030,
"ctxt": 0
},
"base": {
"type": "MemberExpression",
"span": {
"start": 1028,
"end": 1035,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 1028,
"end": 1029,
"ctxt": 0
},
"value": "x",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 1031,
"end": 1035,
"ctxt": 0
},
"value": "kind",
"optional": false
}
}
},
"right": {
"type": "NullLiteral",
"span": {
"start": 1040,
"end": 1044,
"ctxt": 0
}
}
},
"consequent": {
"type": "BlockStatement",
"span": {
"start": 1046,
"end": 1073,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 1056,
"end": 1058,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 1056,
"end": 1057,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
]
},
"alternate": {
"type": "BlockStatement",
"span": {
"start": 1083,
"end": 1122,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 1093,
"end": 1095,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 1093,
"end": 1094,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
]
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 1135,
"end": 1137,
"ctxt": 0
},
"value": "f6",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 1138,
"end": 1158,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 1138,
"end": 1158,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1139,
"end": 1158,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 1141,
"end": 1158,
"ctxt": 0
},
"types": [
{
"type": "TsTypeReference",
"span": {
"start": 1141,
"end": 1142,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1141,
"end": 1142,
"ctxt": 0
},
"value": "X",
"optional": false
},
"typeParams": null
},
{
"type": "TsTypeReference",
"span": {
"start": 1145,
"end": 1146,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1145,
"end": 1146,
"ctxt": 0
},
"value": "N",
"optional": false
},
"typeParams": null
},
{
"type": "TsKeywordType",
"span": {
"start": 1149,
"end": 1158,
"ctxt": 0
},
"kind": "undefined"
}
]
}
}
}
}
],
"decorators": [],
"span": {
"start": 1126,
"end": 1258,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 1160,
"end": 1258,
"ctxt": 0
},
"stmts": [
{
"type": "IfStatement",
"span": {
"start": 1166,
"end": 1256,
"ctxt": 0
},
"test": {
"type": "BinaryExpression",
"span": {
"start": 1170,
"end": 1186,
"ctxt": 0
},
"operator": "===",
"left": {
"type": "OptionalChainingExpression",
"span": {
"start": 1170,
"end": 1177,
"ctxt": 0
},
"questionDotToken": {
"start": 1171,
"end": 1172,
"ctxt": 0
},
"base": {
"type": "MemberExpression",
"span": {
"start": 1170,
"end": 1177,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 1170,
"end": 1171,
"ctxt": 0
},
"value": "x",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 1173,
"end": 1177,
"ctxt": 0
},
"value": "kind",
"optional": false
}
}
},
"right": {
"type": "NullLiteral",
"span": {
"start": 1182,
"end": 1186,
"ctxt": 0
}
}
},
"consequent": {
"type": "BlockStatement",
"span": {
"start": 1188,
"end": 1211,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 1198,
"end": 1200,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 1198,
"end": 1199,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
]
},
"alternate": {
"type": "BlockStatement",
"span": {
"start": 1221,
"end": 1256,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 1231,
"end": 1233,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 1231,
"end": 1232,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
]
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 1269,
"end": 1271,
"ctxt": 0
},
"value": "f7",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 1272,
"end": 1287,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 1272,
"end": 1287,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1273,
"end": 1287,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 1275,
"end": 1287,
"ctxt": 0
},
"types": [
{
"type": "TsTypeReference",
"span": {
"start": 1275,
"end": 1276,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1275,
"end": 1276,
"ctxt": 0
},
"value": "X",
"optional": false
},
"typeParams": null
},
{
"type": "TsTypeReference",
"span": {
"start": 1279,
"end": 1280,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1279,
"end": 1280,
"ctxt": 0
},
"value": "U",
"optional": false
},
"typeParams": null
},
{
"type": "TsKeywordType",
"span": {
"start": 1283,
"end": 1287,
"ctxt": 0
},
"kind": "null"
}
]
}
}
}
}
],
"decorators": [],
"span": {
"start": 1260,
"end": 1390,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 1289,
"end": 1390,
"ctxt": 0
},
"stmts": [
{
"type": "IfStatement",
"span": {
"start": 1295,
"end": 1388,
"ctxt": 0
},
"test": {
"type": "BinaryExpression",
"span": {
"start": 1299,
"end": 1315,
"ctxt": 0
},
"operator": "===",
"left": {
"type": "OptionalChainingExpression",
"span": {
"start": 1299,
"end": 1306,
"ctxt": 0
},
"questionDotToken": {
"start": 1300,
"end": 1301,
"ctxt": 0
},
"base": {
"type": "MemberExpression",
"span": {
"start": 1299,
"end": 1306,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 1299,
"end": 1300,
"ctxt": 0
},
"value": "x",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 1302,
"end": 1306,
"ctxt": 0
},
"value": "kind",
"optional": false
}
}
},
"right": {
"type": "NullLiteral",
"span": {
"start": 1311,
"end": 1315,
"ctxt": 0
}
}
},
"consequent": {
"type": "BlockStatement",
"span": {
"start": 1317,
"end": 1344,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 1327,
"end": 1329,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 1327,
"end": 1328,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
]
},
"alternate": {
"type": "BlockStatement",
"span": {
"start": 1354,
"end": 1388,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 1364,
"end": 1366,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 1364,
"end": 1365,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
]
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 1401,
"end": 1403,
"ctxt": 0
},
"value": "f8",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 1404,
"end": 1419,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 1404,
"end": 1419,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1405,
"end": 1419,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 1407,
"end": 1419,
"ctxt": 0
},
"types": [
{
"type": "TsTypeReference",
"span": {
"start": 1407,
"end": 1408,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1407,
"end": 1408,
"ctxt": 0
},
"value": "X",
"optional": false
},
"typeParams": null
},
{
"type": "TsTypeReference",
"span": {
"start": 1411,
"end": 1412,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1411,
"end": 1412,
"ctxt": 0
},
"value": "N",
"optional": false
},
"typeParams": null
},
{
"type": "TsKeywordType",
"span": {
"start": 1415,
"end": 1419,
"ctxt": 0
},
"kind": "null"
}
]
}
}
}
}
],
"decorators": [],
"span": {
"start": 1392,
"end": 1514,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 1421,
"end": 1514,
"ctxt": 0
},
"stmts": [
{
"type": "IfStatement",
"span": {
"start": 1427,
"end": 1512,
"ctxt": 0
},
"test": {
"type": "BinaryExpression",
"span": {
"start": 1431,
"end": 1447,
"ctxt": 0
},
"operator": "===",
"left": {
"type": "OptionalChainingExpression",
"span": {
"start": 1431,
"end": 1438,
"ctxt": 0
},
"questionDotToken": {
"start": 1432,
"end": 1433,
"ctxt": 0
},
"base": {
"type": "MemberExpression",
"span": {
"start": 1431,
"end": 1438,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 1431,
"end": 1432,
"ctxt": 0
},
"value": "x",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 1434,
"end": 1438,
"ctxt": 0
},
"value": "kind",
"optional": false
}
}
},
"right": {
"type": "NullLiteral",
"span": {
"start": 1443,
"end": 1447,
"ctxt": 0
}
}
},
"consequent": {
"type": "BlockStatement",
"span": {
"start": 1449,
"end": 1472,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 1459,
"end": 1461,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 1459,
"end": 1460,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
]
},
"alternate": {
"type": "BlockStatement",
"span": {
"start": 1482,
"end": 1512,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 1492,
"end": 1494,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 1492,
"end": 1493,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
]
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
],
"interpreter": null
}