mirror of
https://github.com/swc-project/swc.git
synced 2024-12-19 03:31:45 +03:00
8297 lines
244 KiB
JSON
8297 lines
244 KiB
JSON
{
|
|
"type": "Script",
|
|
"span": {
|
|
"start": 72,
|
|
"end": 4857,
|
|
"ctxt": 0
|
|
},
|
|
"body": [
|
|
{
|
|
"type": "FunctionDeclaration",
|
|
"identifier": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 81,
|
|
"end": 83,
|
|
"ctxt": 0
|
|
},
|
|
"value": "f1",
|
|
"optional": false
|
|
},
|
|
"declare": false,
|
|
"params": [
|
|
{
|
|
"type": "Parameter",
|
|
"span": {
|
|
"start": 84,
|
|
"end": 92,
|
|
"ctxt": 0
|
|
},
|
|
"decorators": [],
|
|
"pat": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 84,
|
|
"end": 92,
|
|
"ctxt": 0
|
|
},
|
|
"value": "x",
|
|
"optional": false,
|
|
"typeAnnotation": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 85,
|
|
"end": 92,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsUnionType",
|
|
"span": {
|
|
"start": 87,
|
|
"end": 92,
|
|
"ctxt": 0
|
|
},
|
|
"types": [
|
|
{
|
|
"type": "TsLiteralType",
|
|
"span": {
|
|
"start": 87,
|
|
"end": 88,
|
|
"ctxt": 0
|
|
},
|
|
"literal": {
|
|
"type": "NumericLiteral",
|
|
"span": {
|
|
"start": 87,
|
|
"end": 88,
|
|
"ctxt": 0
|
|
},
|
|
"value": 1.0
|
|
}
|
|
},
|
|
{
|
|
"type": "TsLiteralType",
|
|
"span": {
|
|
"start": 91,
|
|
"end": 92,
|
|
"ctxt": 0
|
|
},
|
|
"literal": {
|
|
"type": "NumericLiteral",
|
|
"span": {
|
|
"start": 91,
|
|
"end": 92,
|
|
"ctxt": 0
|
|
},
|
|
"value": 2.0
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"decorators": [],
|
|
"span": {
|
|
"start": 72,
|
|
"end": 285,
|
|
"ctxt": 0
|
|
},
|
|
"body": {
|
|
"type": "BlockStatement",
|
|
"span": {
|
|
"start": 102,
|
|
"end": 285,
|
|
"ctxt": 0
|
|
},
|
|
"stmts": [
|
|
{
|
|
"type": "IfStatement",
|
|
"span": {
|
|
"start": 108,
|
|
"end": 283,
|
|
"ctxt": 0
|
|
},
|
|
"test": {
|
|
"type": "UnaryExpression",
|
|
"span": {
|
|
"start": 112,
|
|
"end": 118,
|
|
"ctxt": 0
|
|
},
|
|
"operator": "!",
|
|
"argument": {
|
|
"type": "UnaryExpression",
|
|
"span": {
|
|
"start": 113,
|
|
"end": 118,
|
|
"ctxt": 0
|
|
},
|
|
"operator": "!",
|
|
"argument": {
|
|
"type": "BooleanLiteral",
|
|
"span": {
|
|
"start": 114,
|
|
"end": 118,
|
|
"ctxt": 0
|
|
},
|
|
"value": true
|
|
}
|
|
}
|
|
},
|
|
"consequent": {
|
|
"type": "BlockStatement",
|
|
"span": {
|
|
"start": 120,
|
|
"end": 249,
|
|
"ctxt": 0
|
|
},
|
|
"stmts": [
|
|
{
|
|
"type": "SwitchStatement",
|
|
"span": {
|
|
"start": 130,
|
|
"end": 216,
|
|
"ctxt": 0
|
|
},
|
|
"discriminant": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 138,
|
|
"end": 139,
|
|
"ctxt": 0
|
|
},
|
|
"value": "x",
|
|
"optional": false
|
|
},
|
|
"cases": [
|
|
{
|
|
"type": "SwitchCase",
|
|
"span": {
|
|
"start": 155,
|
|
"end": 174,
|
|
"ctxt": 0
|
|
},
|
|
"test": {
|
|
"type": "NumericLiteral",
|
|
"span": {
|
|
"start": 160,
|
|
"end": 161,
|
|
"ctxt": 0
|
|
},
|
|
"value": 1.0
|
|
},
|
|
"consequent": [
|
|
{
|
|
"type": "ReturnStatement",
|
|
"span": {
|
|
"start": 163,
|
|
"end": 174,
|
|
"ctxt": 0
|
|
},
|
|
"argument": {
|
|
"type": "StringLiteral",
|
|
"span": {
|
|
"start": 170,
|
|
"end": 173,
|
|
"ctxt": 0
|
|
},
|
|
"value": "a",
|
|
"hasEscape": false,
|
|
"kind": {
|
|
"type": "normal",
|
|
"containsQuote": true
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "SwitchCase",
|
|
"span": {
|
|
"start": 187,
|
|
"end": 206,
|
|
"ctxt": 0
|
|
},
|
|
"test": {
|
|
"type": "NumericLiteral",
|
|
"span": {
|
|
"start": 192,
|
|
"end": 193,
|
|
"ctxt": 0
|
|
},
|
|
"value": 2.0
|
|
},
|
|
"consequent": [
|
|
{
|
|
"type": "ReturnStatement",
|
|
"span": {
|
|
"start": 195,
|
|
"end": 206,
|
|
"ctxt": 0
|
|
},
|
|
"argument": {
|
|
"type": "StringLiteral",
|
|
"span": {
|
|
"start": 202,
|
|
"end": 205,
|
|
"ctxt": 0
|
|
},
|
|
"value": "b",
|
|
"hasEscape": false,
|
|
"kind": {
|
|
"type": "normal",
|
|
"containsQuote": true
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "ExpressionStatement",
|
|
"span": {
|
|
"start": 225,
|
|
"end": 227,
|
|
"ctxt": 0
|
|
},
|
|
"expression": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 225,
|
|
"end": 226,
|
|
"ctxt": 0
|
|
},
|
|
"value": "x",
|
|
"optional": false
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"alternate": {
|
|
"type": "BlockStatement",
|
|
"span": {
|
|
"start": 259,
|
|
"end": 283,
|
|
"ctxt": 0
|
|
},
|
|
"stmts": [
|
|
{
|
|
"type": "ThrowStatement",
|
|
"span": {
|
|
"start": 269,
|
|
"end": 277,
|
|
"ctxt": 0
|
|
},
|
|
"argument": {
|
|
"type": "NumericLiteral",
|
|
"span": {
|
|
"start": 275,
|
|
"end": 276,
|
|
"ctxt": 0
|
|
},
|
|
"value": 0.0
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"generator": false,
|
|
"async": false,
|
|
"typeParameters": null,
|
|
"returnType": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 93,
|
|
"end": 101,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsKeywordType",
|
|
"span": {
|
|
"start": 95,
|
|
"end": 101,
|
|
"ctxt": 0
|
|
},
|
|
"kind": "string"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"type": "FunctionDeclaration",
|
|
"identifier": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 296,
|
|
"end": 298,
|
|
"ctxt": 0
|
|
},
|
|
"value": "f2",
|
|
"optional": false
|
|
},
|
|
"declare": false,
|
|
"params": [
|
|
{
|
|
"type": "Parameter",
|
|
"span": {
|
|
"start": 299,
|
|
"end": 307,
|
|
"ctxt": 0
|
|
},
|
|
"decorators": [],
|
|
"pat": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 299,
|
|
"end": 307,
|
|
"ctxt": 0
|
|
},
|
|
"value": "x",
|
|
"optional": false,
|
|
"typeAnnotation": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 300,
|
|
"end": 307,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsUnionType",
|
|
"span": {
|
|
"start": 302,
|
|
"end": 307,
|
|
"ctxt": 0
|
|
},
|
|
"types": [
|
|
{
|
|
"type": "TsLiteralType",
|
|
"span": {
|
|
"start": 302,
|
|
"end": 303,
|
|
"ctxt": 0
|
|
},
|
|
"literal": {
|
|
"type": "NumericLiteral",
|
|
"span": {
|
|
"start": 302,
|
|
"end": 303,
|
|
"ctxt": 0
|
|
},
|
|
"value": 1.0
|
|
}
|
|
},
|
|
{
|
|
"type": "TsLiteralType",
|
|
"span": {
|
|
"start": 306,
|
|
"end": 307,
|
|
"ctxt": 0
|
|
},
|
|
"literal": {
|
|
"type": "NumericLiteral",
|
|
"span": {
|
|
"start": 306,
|
|
"end": 307,
|
|
"ctxt": 0
|
|
},
|
|
"value": 2.0
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"decorators": [],
|
|
"span": {
|
|
"start": 287,
|
|
"end": 447,
|
|
"ctxt": 0
|
|
},
|
|
"body": {
|
|
"type": "BlockStatement",
|
|
"span": {
|
|
"start": 309,
|
|
"end": 447,
|
|
"ctxt": 0
|
|
},
|
|
"stmts": [
|
|
{
|
|
"type": "VariableDeclaration",
|
|
"span": {
|
|
"start": 315,
|
|
"end": 329,
|
|
"ctxt": 0
|
|
},
|
|
"kind": "let",
|
|
"declare": false,
|
|
"declarations": [
|
|
{
|
|
"type": "VariableDeclarator",
|
|
"span": {
|
|
"start": 319,
|
|
"end": 328,
|
|
"ctxt": 0
|
|
},
|
|
"id": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 319,
|
|
"end": 320,
|
|
"ctxt": 0
|
|
},
|
|
"value": "z",
|
|
"optional": false,
|
|
"typeAnnotation": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 320,
|
|
"end": 328,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsKeywordType",
|
|
"span": {
|
|
"start": 322,
|
|
"end": 328,
|
|
"ctxt": 0
|
|
},
|
|
"kind": "number"
|
|
}
|
|
}
|
|
},
|
|
"init": null,
|
|
"definite": false
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "SwitchStatement",
|
|
"span": {
|
|
"start": 334,
|
|
"end": 414,
|
|
"ctxt": 0
|
|
},
|
|
"discriminant": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 342,
|
|
"end": 343,
|
|
"ctxt": 0
|
|
},
|
|
"value": "x",
|
|
"optional": false
|
|
},
|
|
"cases": [
|
|
{
|
|
"type": "SwitchCase",
|
|
"span": {
|
|
"start": 355,
|
|
"end": 377,
|
|
"ctxt": 0
|
|
},
|
|
"test": {
|
|
"type": "NumericLiteral",
|
|
"span": {
|
|
"start": 360,
|
|
"end": 361,
|
|
"ctxt": 0
|
|
},
|
|
"value": 1.0
|
|
},
|
|
"consequent": [
|
|
{
|
|
"type": "ExpressionStatement",
|
|
"span": {
|
|
"start": 363,
|
|
"end": 370,
|
|
"ctxt": 0
|
|
},
|
|
"expression": {
|
|
"type": "AssignmentExpression",
|
|
"span": {
|
|
"start": 363,
|
|
"end": 369,
|
|
"ctxt": 0
|
|
},
|
|
"operator": "=",
|
|
"left": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 363,
|
|
"end": 364,
|
|
"ctxt": 0
|
|
},
|
|
"value": "z",
|
|
"optional": false,
|
|
"typeAnnotation": null
|
|
},
|
|
"right": {
|
|
"type": "NumericLiteral",
|
|
"span": {
|
|
"start": 367,
|
|
"end": 369,
|
|
"ctxt": 0
|
|
},
|
|
"value": 10.0
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"type": "BreakStatement",
|
|
"span": {
|
|
"start": 371,
|
|
"end": 377,
|
|
"ctxt": 0
|
|
},
|
|
"label": null
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "SwitchCase",
|
|
"span": {
|
|
"start": 386,
|
|
"end": 408,
|
|
"ctxt": 0
|
|
},
|
|
"test": {
|
|
"type": "NumericLiteral",
|
|
"span": {
|
|
"start": 391,
|
|
"end": 392,
|
|
"ctxt": 0
|
|
},
|
|
"value": 2.0
|
|
},
|
|
"consequent": [
|
|
{
|
|
"type": "ExpressionStatement",
|
|
"span": {
|
|
"start": 394,
|
|
"end": 401,
|
|
"ctxt": 0
|
|
},
|
|
"expression": {
|
|
"type": "AssignmentExpression",
|
|
"span": {
|
|
"start": 394,
|
|
"end": 400,
|
|
"ctxt": 0
|
|
},
|
|
"operator": "=",
|
|
"left": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 394,
|
|
"end": 395,
|
|
"ctxt": 0
|
|
},
|
|
"value": "z",
|
|
"optional": false,
|
|
"typeAnnotation": null
|
|
},
|
|
"right": {
|
|
"type": "NumericLiteral",
|
|
"span": {
|
|
"start": 398,
|
|
"end": 400,
|
|
"ctxt": 0
|
|
},
|
|
"value": 20.0
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"type": "BreakStatement",
|
|
"span": {
|
|
"start": 402,
|
|
"end": 408,
|
|
"ctxt": 0
|
|
},
|
|
"label": null
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "ExpressionStatement",
|
|
"span": {
|
|
"start": 419,
|
|
"end": 421,
|
|
"ctxt": 0
|
|
},
|
|
"expression": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 419,
|
|
"end": 420,
|
|
"ctxt": 0
|
|
},
|
|
"value": "z",
|
|
"optional": false
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"generator": false,
|
|
"async": false,
|
|
"typeParameters": null,
|
|
"returnType": null
|
|
},
|
|
{
|
|
"type": "FunctionDeclaration",
|
|
"identifier": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 458,
|
|
"end": 460,
|
|
"ctxt": 0
|
|
},
|
|
"value": "f3",
|
|
"optional": false
|
|
},
|
|
"declare": false,
|
|
"params": [
|
|
{
|
|
"type": "Parameter",
|
|
"span": {
|
|
"start": 461,
|
|
"end": 469,
|
|
"ctxt": 0
|
|
},
|
|
"decorators": [],
|
|
"pat": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 461,
|
|
"end": 469,
|
|
"ctxt": 0
|
|
},
|
|
"value": "x",
|
|
"optional": false,
|
|
"typeAnnotation": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 462,
|
|
"end": 469,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsUnionType",
|
|
"span": {
|
|
"start": 464,
|
|
"end": 469,
|
|
"ctxt": 0
|
|
},
|
|
"types": [
|
|
{
|
|
"type": "TsLiteralType",
|
|
"span": {
|
|
"start": 464,
|
|
"end": 465,
|
|
"ctxt": 0
|
|
},
|
|
"literal": {
|
|
"type": "NumericLiteral",
|
|
"span": {
|
|
"start": 464,
|
|
"end": 465,
|
|
"ctxt": 0
|
|
},
|
|
"value": 1.0
|
|
}
|
|
},
|
|
{
|
|
"type": "TsLiteralType",
|
|
"span": {
|
|
"start": 468,
|
|
"end": 469,
|
|
"ctxt": 0
|
|
},
|
|
"literal": {
|
|
"type": "NumericLiteral",
|
|
"span": {
|
|
"start": 468,
|
|
"end": 469,
|
|
"ctxt": 0
|
|
},
|
|
"value": 2.0
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"decorators": [],
|
|
"span": {
|
|
"start": 449,
|
|
"end": 664,
|
|
"ctxt": 0
|
|
},
|
|
"body": {
|
|
"type": "BlockStatement",
|
|
"span": {
|
|
"start": 471,
|
|
"end": 664,
|
|
"ctxt": 0
|
|
},
|
|
"stmts": [
|
|
{
|
|
"type": "SwitchStatement",
|
|
"span": {
|
|
"start": 477,
|
|
"end": 662,
|
|
"ctxt": 0
|
|
},
|
|
"discriminant": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 485,
|
|
"end": 486,
|
|
"ctxt": 0
|
|
},
|
|
"value": "x",
|
|
"optional": false
|
|
},
|
|
"cases": [
|
|
{
|
|
"type": "SwitchCase",
|
|
"span": {
|
|
"start": 498,
|
|
"end": 516,
|
|
"ctxt": 0
|
|
},
|
|
"test": {
|
|
"type": "NumericLiteral",
|
|
"span": {
|
|
"start": 503,
|
|
"end": 504,
|
|
"ctxt": 0
|
|
},
|
|
"value": 1.0
|
|
},
|
|
"consequent": [
|
|
{
|
|
"type": "ReturnStatement",
|
|
"span": {
|
|
"start": 506,
|
|
"end": 516,
|
|
"ctxt": 0
|
|
},
|
|
"argument": {
|
|
"type": "NumericLiteral",
|
|
"span": {
|
|
"start": 513,
|
|
"end": 515,
|
|
"ctxt": 0
|
|
},
|
|
"value": 10.0
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "SwitchCase",
|
|
"span": {
|
|
"start": 525,
|
|
"end": 543,
|
|
"ctxt": 0
|
|
},
|
|
"test": {
|
|
"type": "NumericLiteral",
|
|
"span": {
|
|
"start": 530,
|
|
"end": 531,
|
|
"ctxt": 0
|
|
},
|
|
"value": 2.0
|
|
},
|
|
"consequent": [
|
|
{
|
|
"type": "ReturnStatement",
|
|
"span": {
|
|
"start": 533,
|
|
"end": 543,
|
|
"ctxt": 0
|
|
},
|
|
"argument": {
|
|
"type": "NumericLiteral",
|
|
"span": {
|
|
"start": 540,
|
|
"end": 542,
|
|
"ctxt": 0
|
|
},
|
|
"value": 20.0
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "SwitchCase",
|
|
"span": {
|
|
"start": 618,
|
|
"end": 656,
|
|
"ctxt": 0
|
|
},
|
|
"test": null,
|
|
"consequent": [
|
|
{
|
|
"type": "ThrowStatement",
|
|
"span": {
|
|
"start": 627,
|
|
"end": 656,
|
|
"ctxt": 0
|
|
},
|
|
"argument": {
|
|
"type": "NewExpression",
|
|
"span": {
|
|
"start": 633,
|
|
"end": 655,
|
|
"ctxt": 0
|
|
},
|
|
"callee": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 637,
|
|
"end": 642,
|
|
"ctxt": 0
|
|
},
|
|
"value": "Error",
|
|
"optional": false
|
|
},
|
|
"arguments": [
|
|
{
|
|
"spread": null,
|
|
"expression": {
|
|
"type": "StringLiteral",
|
|
"span": {
|
|
"start": 643,
|
|
"end": 654,
|
|
"ctxt": 0
|
|
},
|
|
"value": "Bad input",
|
|
"hasEscape": false,
|
|
"kind": {
|
|
"type": "normal",
|
|
"containsQuote": true
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"typeArguments": null
|
|
}
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"generator": false,
|
|
"async": false,
|
|
"typeParameters": null,
|
|
"returnType": null
|
|
},
|
|
{
|
|
"type": "TsEnumDeclaration",
|
|
"span": {
|
|
"start": 688,
|
|
"end": 703,
|
|
"ctxt": 0
|
|
},
|
|
"declare": false,
|
|
"isConst": false,
|
|
"id": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 693,
|
|
"end": 694,
|
|
"ctxt": 0
|
|
},
|
|
"value": "E",
|
|
"optional": false
|
|
},
|
|
"members": [
|
|
{
|
|
"type": "TsEnumMember",
|
|
"span": {
|
|
"start": 697,
|
|
"end": 698,
|
|
"ctxt": 0
|
|
},
|
|
"id": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 697,
|
|
"end": 698,
|
|
"ctxt": 0
|
|
},
|
|
"value": "A",
|
|
"optional": false
|
|
},
|
|
"init": null
|
|
},
|
|
{
|
|
"type": "TsEnumMember",
|
|
"span": {
|
|
"start": 700,
|
|
"end": 701,
|
|
"ctxt": 0
|
|
},
|
|
"id": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 700,
|
|
"end": 701,
|
|
"ctxt": 0
|
|
},
|
|
"value": "B",
|
|
"optional": false
|
|
},
|
|
"init": null
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "FunctionDeclaration",
|
|
"identifier": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 714,
|
|
"end": 715,
|
|
"ctxt": 0
|
|
},
|
|
"value": "f",
|
|
"optional": false
|
|
},
|
|
"declare": false,
|
|
"params": [
|
|
{
|
|
"type": "Parameter",
|
|
"span": {
|
|
"start": 716,
|
|
"end": 720,
|
|
"ctxt": 0
|
|
},
|
|
"decorators": [],
|
|
"pat": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 716,
|
|
"end": 720,
|
|
"ctxt": 0
|
|
},
|
|
"value": "e",
|
|
"optional": false,
|
|
"typeAnnotation": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 717,
|
|
"end": 720,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsTypeReference",
|
|
"span": {
|
|
"start": 719,
|
|
"end": 720,
|
|
"ctxt": 0
|
|
},
|
|
"typeName": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 719,
|
|
"end": 720,
|
|
"ctxt": 0
|
|
},
|
|
"value": "E",
|
|
"optional": false
|
|
},
|
|
"typeParams": null
|
|
}
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"decorators": [],
|
|
"span": {
|
|
"start": 705,
|
|
"end": 810,
|
|
"ctxt": 0
|
|
},
|
|
"body": {
|
|
"type": "BlockStatement",
|
|
"span": {
|
|
"start": 730,
|
|
"end": 810,
|
|
"ctxt": 0
|
|
},
|
|
"stmts": [
|
|
{
|
|
"type": "SwitchStatement",
|
|
"span": {
|
|
"start": 736,
|
|
"end": 808,
|
|
"ctxt": 0
|
|
},
|
|
"discriminant": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 744,
|
|
"end": 745,
|
|
"ctxt": 0
|
|
},
|
|
"value": "e",
|
|
"optional": false
|
|
},
|
|
"cases": [
|
|
{
|
|
"type": "SwitchCase",
|
|
"span": {
|
|
"start": 757,
|
|
"end": 775,
|
|
"ctxt": 0
|
|
},
|
|
"test": {
|
|
"type": "MemberExpression",
|
|
"span": {
|
|
"start": 762,
|
|
"end": 765,
|
|
"ctxt": 0
|
|
},
|
|
"object": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 762,
|
|
"end": 763,
|
|
"ctxt": 0
|
|
},
|
|
"value": "E",
|
|
"optional": false
|
|
},
|
|
"property": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 764,
|
|
"end": 765,
|
|
"ctxt": 0
|
|
},
|
|
"value": "A",
|
|
"optional": false
|
|
}
|
|
},
|
|
"consequent": [
|
|
{
|
|
"type": "ReturnStatement",
|
|
"span": {
|
|
"start": 767,
|
|
"end": 775,
|
|
"ctxt": 0
|
|
},
|
|
"argument": {
|
|
"type": "NumericLiteral",
|
|
"span": {
|
|
"start": 774,
|
|
"end": 775,
|
|
"ctxt": 0
|
|
},
|
|
"value": 0.0
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "SwitchCase",
|
|
"span": {
|
|
"start": 784,
|
|
"end": 802,
|
|
"ctxt": 0
|
|
},
|
|
"test": {
|
|
"type": "MemberExpression",
|
|
"span": {
|
|
"start": 789,
|
|
"end": 792,
|
|
"ctxt": 0
|
|
},
|
|
"object": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 789,
|
|
"end": 790,
|
|
"ctxt": 0
|
|
},
|
|
"value": "E",
|
|
"optional": false
|
|
},
|
|
"property": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 791,
|
|
"end": 792,
|
|
"ctxt": 0
|
|
},
|
|
"value": "B",
|
|
"optional": false
|
|
}
|
|
},
|
|
"consequent": [
|
|
{
|
|
"type": "ReturnStatement",
|
|
"span": {
|
|
"start": 794,
|
|
"end": 802,
|
|
"ctxt": 0
|
|
},
|
|
"argument": {
|
|
"type": "NumericLiteral",
|
|
"span": {
|
|
"start": 801,
|
|
"end": 802,
|
|
"ctxt": 0
|
|
},
|
|
"value": 1.0
|
|
}
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"generator": false,
|
|
"async": false,
|
|
"typeParameters": null,
|
|
"returnType": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 721,
|
|
"end": 729,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsKeywordType",
|
|
"span": {
|
|
"start": 723,
|
|
"end": 729,
|
|
"ctxt": 0
|
|
},
|
|
"kind": "number"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"type": "FunctionDeclaration",
|
|
"identifier": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 821,
|
|
"end": 822,
|
|
"ctxt": 0
|
|
},
|
|
"value": "g",
|
|
"optional": false
|
|
},
|
|
"declare": false,
|
|
"params": [
|
|
{
|
|
"type": "Parameter",
|
|
"span": {
|
|
"start": 823,
|
|
"end": 827,
|
|
"ctxt": 0
|
|
},
|
|
"decorators": [],
|
|
"pat": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 823,
|
|
"end": 827,
|
|
"ctxt": 0
|
|
},
|
|
"value": "e",
|
|
"optional": false,
|
|
"typeAnnotation": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 824,
|
|
"end": 827,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsTypeReference",
|
|
"span": {
|
|
"start": 826,
|
|
"end": 827,
|
|
"ctxt": 0
|
|
},
|
|
"typeName": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 826,
|
|
"end": 827,
|
|
"ctxt": 0
|
|
},
|
|
"value": "E",
|
|
"optional": false
|
|
},
|
|
"typeParams": null
|
|
}
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"decorators": [],
|
|
"span": {
|
|
"start": 812,
|
|
"end": 975,
|
|
"ctxt": 0
|
|
},
|
|
"body": {
|
|
"type": "BlockStatement",
|
|
"span": {
|
|
"start": 837,
|
|
"end": 975,
|
|
"ctxt": 0
|
|
},
|
|
"stmts": [
|
|
{
|
|
"type": "IfStatement",
|
|
"span": {
|
|
"start": 843,
|
|
"end": 973,
|
|
"ctxt": 0
|
|
},
|
|
"test": {
|
|
"type": "UnaryExpression",
|
|
"span": {
|
|
"start": 847,
|
|
"end": 852,
|
|
"ctxt": 0
|
|
},
|
|
"operator": "!",
|
|
"argument": {
|
|
"type": "BooleanLiteral",
|
|
"span": {
|
|
"start": 848,
|
|
"end": 852,
|
|
"ctxt": 0
|
|
},
|
|
"value": true
|
|
}
|
|
},
|
|
"consequent": {
|
|
"type": "ReturnStatement",
|
|
"span": {
|
|
"start": 862,
|
|
"end": 871,
|
|
"ctxt": 0
|
|
},
|
|
"argument": {
|
|
"type": "UnaryExpression",
|
|
"span": {
|
|
"start": 869,
|
|
"end": 871,
|
|
"ctxt": 0
|
|
},
|
|
"operator": "-",
|
|
"argument": {
|
|
"type": "NumericLiteral",
|
|
"span": {
|
|
"start": 870,
|
|
"end": 871,
|
|
"ctxt": 0
|
|
},
|
|
"value": 1.0
|
|
}
|
|
}
|
|
},
|
|
"alternate": {
|
|
"type": "SwitchStatement",
|
|
"span": {
|
|
"start": 889,
|
|
"end": 973,
|
|
"ctxt": 0
|
|
},
|
|
"discriminant": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 897,
|
|
"end": 898,
|
|
"ctxt": 0
|
|
},
|
|
"value": "e",
|
|
"optional": false
|
|
},
|
|
"cases": [
|
|
{
|
|
"type": "SwitchCase",
|
|
"span": {
|
|
"start": 914,
|
|
"end": 932,
|
|
"ctxt": 0
|
|
},
|
|
"test": {
|
|
"type": "MemberExpression",
|
|
"span": {
|
|
"start": 919,
|
|
"end": 922,
|
|
"ctxt": 0
|
|
},
|
|
"object": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 919,
|
|
"end": 920,
|
|
"ctxt": 0
|
|
},
|
|
"value": "E",
|
|
"optional": false
|
|
},
|
|
"property": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 921,
|
|
"end": 922,
|
|
"ctxt": 0
|
|
},
|
|
"value": "A",
|
|
"optional": false
|
|
}
|
|
},
|
|
"consequent": [
|
|
{
|
|
"type": "ReturnStatement",
|
|
"span": {
|
|
"start": 924,
|
|
"end": 932,
|
|
"ctxt": 0
|
|
},
|
|
"argument": {
|
|
"type": "NumericLiteral",
|
|
"span": {
|
|
"start": 931,
|
|
"end": 932,
|
|
"ctxt": 0
|
|
},
|
|
"value": 0.0
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "SwitchCase",
|
|
"span": {
|
|
"start": 945,
|
|
"end": 963,
|
|
"ctxt": 0
|
|
},
|
|
"test": {
|
|
"type": "MemberExpression",
|
|
"span": {
|
|
"start": 950,
|
|
"end": 953,
|
|
"ctxt": 0
|
|
},
|
|
"object": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 950,
|
|
"end": 951,
|
|
"ctxt": 0
|
|
},
|
|
"value": "E",
|
|
"optional": false
|
|
},
|
|
"property": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 952,
|
|
"end": 953,
|
|
"ctxt": 0
|
|
},
|
|
"value": "B",
|
|
"optional": false
|
|
}
|
|
},
|
|
"consequent": [
|
|
{
|
|
"type": "ReturnStatement",
|
|
"span": {
|
|
"start": 955,
|
|
"end": 963,
|
|
"ctxt": 0
|
|
},
|
|
"argument": {
|
|
"type": "NumericLiteral",
|
|
"span": {
|
|
"start": 962,
|
|
"end": 963,
|
|
"ctxt": 0
|
|
},
|
|
"value": 1.0
|
|
}
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"generator": false,
|
|
"async": false,
|
|
"typeParameters": null,
|
|
"returnType": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 828,
|
|
"end": 836,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsKeywordType",
|
|
"span": {
|
|
"start": 830,
|
|
"end": 836,
|
|
"ctxt": 0
|
|
},
|
|
"kind": "number"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"type": "TsInterfaceDeclaration",
|
|
"span": {
|
|
"start": 999,
|
|
"end": 1049,
|
|
"ctxt": 0
|
|
},
|
|
"id": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1009,
|
|
"end": 1015,
|
|
"ctxt": 0
|
|
},
|
|
"value": "Square",
|
|
"optional": false
|
|
},
|
|
"declare": false,
|
|
"typeParams": null,
|
|
"extends": [],
|
|
"body": {
|
|
"type": "TsInterfaceBody",
|
|
"span": {
|
|
"start": 1016,
|
|
"end": 1049,
|
|
"ctxt": 0
|
|
},
|
|
"body": [
|
|
{
|
|
"type": "TsPropertySignature",
|
|
"span": {
|
|
"start": 1018,
|
|
"end": 1033,
|
|
"ctxt": 0
|
|
},
|
|
"readonly": false,
|
|
"key": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1018,
|
|
"end": 1022,
|
|
"ctxt": 0
|
|
},
|
|
"value": "kind",
|
|
"optional": false
|
|
},
|
|
"computed": false,
|
|
"optional": false,
|
|
"init": null,
|
|
"params": [],
|
|
"typeAnnotation": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 1022,
|
|
"end": 1032,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsLiteralType",
|
|
"span": {
|
|
"start": 1024,
|
|
"end": 1032,
|
|
"ctxt": 0
|
|
},
|
|
"literal": {
|
|
"type": "StringLiteral",
|
|
"span": {
|
|
"start": 1024,
|
|
"end": 1032,
|
|
"ctxt": 0
|
|
},
|
|
"value": "square",
|
|
"hasEscape": false,
|
|
"kind": {
|
|
"type": "normal",
|
|
"containsQuote": true
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"typeParams": null
|
|
},
|
|
{
|
|
"type": "TsPropertySignature",
|
|
"span": {
|
|
"start": 1034,
|
|
"end": 1047,
|
|
"ctxt": 0
|
|
},
|
|
"readonly": false,
|
|
"key": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1034,
|
|
"end": 1038,
|
|
"ctxt": 0
|
|
},
|
|
"value": "size",
|
|
"optional": false
|
|
},
|
|
"computed": false,
|
|
"optional": false,
|
|
"init": null,
|
|
"params": [],
|
|
"typeAnnotation": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 1038,
|
|
"end": 1046,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsKeywordType",
|
|
"span": {
|
|
"start": 1040,
|
|
"end": 1046,
|
|
"ctxt": 0
|
|
},
|
|
"kind": "number"
|
|
}
|
|
},
|
|
"typeParams": null
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "TsInterfaceDeclaration",
|
|
"span": {
|
|
"start": 1051,
|
|
"end": 1124,
|
|
"ctxt": 0
|
|
},
|
|
"id": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1061,
|
|
"end": 1070,
|
|
"ctxt": 0
|
|
},
|
|
"value": "Rectangle",
|
|
"optional": false
|
|
},
|
|
"declare": false,
|
|
"typeParams": null,
|
|
"extends": [],
|
|
"body": {
|
|
"type": "TsInterfaceBody",
|
|
"span": {
|
|
"start": 1071,
|
|
"end": 1124,
|
|
"ctxt": 0
|
|
},
|
|
"body": [
|
|
{
|
|
"type": "TsPropertySignature",
|
|
"span": {
|
|
"start": 1073,
|
|
"end": 1091,
|
|
"ctxt": 0
|
|
},
|
|
"readonly": false,
|
|
"key": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1073,
|
|
"end": 1077,
|
|
"ctxt": 0
|
|
},
|
|
"value": "kind",
|
|
"optional": false
|
|
},
|
|
"computed": false,
|
|
"optional": false,
|
|
"init": null,
|
|
"params": [],
|
|
"typeAnnotation": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 1077,
|
|
"end": 1090,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsLiteralType",
|
|
"span": {
|
|
"start": 1079,
|
|
"end": 1090,
|
|
"ctxt": 0
|
|
},
|
|
"literal": {
|
|
"type": "StringLiteral",
|
|
"span": {
|
|
"start": 1079,
|
|
"end": 1090,
|
|
"ctxt": 0
|
|
},
|
|
"value": "rectangle",
|
|
"hasEscape": false,
|
|
"kind": {
|
|
"type": "normal",
|
|
"containsQuote": true
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"typeParams": null
|
|
},
|
|
{
|
|
"type": "TsPropertySignature",
|
|
"span": {
|
|
"start": 1092,
|
|
"end": 1106,
|
|
"ctxt": 0
|
|
},
|
|
"readonly": false,
|
|
"key": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1092,
|
|
"end": 1097,
|
|
"ctxt": 0
|
|
},
|
|
"value": "width",
|
|
"optional": false
|
|
},
|
|
"computed": false,
|
|
"optional": false,
|
|
"init": null,
|
|
"params": [],
|
|
"typeAnnotation": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 1097,
|
|
"end": 1105,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsKeywordType",
|
|
"span": {
|
|
"start": 1099,
|
|
"end": 1105,
|
|
"ctxt": 0
|
|
},
|
|
"kind": "number"
|
|
}
|
|
},
|
|
"typeParams": null
|
|
},
|
|
{
|
|
"type": "TsPropertySignature",
|
|
"span": {
|
|
"start": 1107,
|
|
"end": 1122,
|
|
"ctxt": 0
|
|
},
|
|
"readonly": false,
|
|
"key": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1107,
|
|
"end": 1113,
|
|
"ctxt": 0
|
|
},
|
|
"value": "height",
|
|
"optional": false
|
|
},
|
|
"computed": false,
|
|
"optional": false,
|
|
"init": null,
|
|
"params": [],
|
|
"typeAnnotation": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 1113,
|
|
"end": 1121,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsKeywordType",
|
|
"span": {
|
|
"start": 1115,
|
|
"end": 1121,
|
|
"ctxt": 0
|
|
},
|
|
"kind": "number"
|
|
}
|
|
},
|
|
"typeParams": null
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "TsInterfaceDeclaration",
|
|
"span": {
|
|
"start": 1126,
|
|
"end": 1178,
|
|
"ctxt": 0
|
|
},
|
|
"id": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1136,
|
|
"end": 1142,
|
|
"ctxt": 0
|
|
},
|
|
"value": "Circle",
|
|
"optional": false
|
|
},
|
|
"declare": false,
|
|
"typeParams": null,
|
|
"extends": [],
|
|
"body": {
|
|
"type": "TsInterfaceBody",
|
|
"span": {
|
|
"start": 1143,
|
|
"end": 1178,
|
|
"ctxt": 0
|
|
},
|
|
"body": [
|
|
{
|
|
"type": "TsPropertySignature",
|
|
"span": {
|
|
"start": 1145,
|
|
"end": 1160,
|
|
"ctxt": 0
|
|
},
|
|
"readonly": false,
|
|
"key": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1145,
|
|
"end": 1149,
|
|
"ctxt": 0
|
|
},
|
|
"value": "kind",
|
|
"optional": false
|
|
},
|
|
"computed": false,
|
|
"optional": false,
|
|
"init": null,
|
|
"params": [],
|
|
"typeAnnotation": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 1149,
|
|
"end": 1159,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsLiteralType",
|
|
"span": {
|
|
"start": 1151,
|
|
"end": 1159,
|
|
"ctxt": 0
|
|
},
|
|
"literal": {
|
|
"type": "StringLiteral",
|
|
"span": {
|
|
"start": 1151,
|
|
"end": 1159,
|
|
"ctxt": 0
|
|
},
|
|
"value": "circle",
|
|
"hasEscape": false,
|
|
"kind": {
|
|
"type": "normal",
|
|
"containsQuote": true
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"typeParams": null
|
|
},
|
|
{
|
|
"type": "TsPropertySignature",
|
|
"span": {
|
|
"start": 1161,
|
|
"end": 1176,
|
|
"ctxt": 0
|
|
},
|
|
"readonly": false,
|
|
"key": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1161,
|
|
"end": 1167,
|
|
"ctxt": 0
|
|
},
|
|
"value": "radius",
|
|
"optional": false
|
|
},
|
|
"computed": false,
|
|
"optional": false,
|
|
"init": null,
|
|
"params": [],
|
|
"typeAnnotation": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 1167,
|
|
"end": 1175,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsKeywordType",
|
|
"span": {
|
|
"start": 1169,
|
|
"end": 1175,
|
|
"ctxt": 0
|
|
},
|
|
"kind": "number"
|
|
}
|
|
},
|
|
"typeParams": null
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "TsInterfaceDeclaration",
|
|
"span": {
|
|
"start": 1180,
|
|
"end": 1234,
|
|
"ctxt": 0
|
|
},
|
|
"id": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1190,
|
|
"end": 1198,
|
|
"ctxt": 0
|
|
},
|
|
"value": "Triangle",
|
|
"optional": false
|
|
},
|
|
"declare": false,
|
|
"typeParams": null,
|
|
"extends": [],
|
|
"body": {
|
|
"type": "TsInterfaceBody",
|
|
"span": {
|
|
"start": 1199,
|
|
"end": 1234,
|
|
"ctxt": 0
|
|
},
|
|
"body": [
|
|
{
|
|
"type": "TsPropertySignature",
|
|
"span": {
|
|
"start": 1201,
|
|
"end": 1218,
|
|
"ctxt": 0
|
|
},
|
|
"readonly": false,
|
|
"key": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1201,
|
|
"end": 1205,
|
|
"ctxt": 0
|
|
},
|
|
"value": "kind",
|
|
"optional": false
|
|
},
|
|
"computed": false,
|
|
"optional": false,
|
|
"init": null,
|
|
"params": [],
|
|
"typeAnnotation": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 1205,
|
|
"end": 1217,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsLiteralType",
|
|
"span": {
|
|
"start": 1207,
|
|
"end": 1217,
|
|
"ctxt": 0
|
|
},
|
|
"literal": {
|
|
"type": "StringLiteral",
|
|
"span": {
|
|
"start": 1207,
|
|
"end": 1217,
|
|
"ctxt": 0
|
|
},
|
|
"value": "triangle",
|
|
"hasEscape": false,
|
|
"kind": {
|
|
"type": "normal",
|
|
"containsQuote": true
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"typeParams": null
|
|
},
|
|
{
|
|
"type": "TsPropertySignature",
|
|
"span": {
|
|
"start": 1219,
|
|
"end": 1232,
|
|
"ctxt": 0
|
|
},
|
|
"readonly": false,
|
|
"key": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1219,
|
|
"end": 1223,
|
|
"ctxt": 0
|
|
},
|
|
"value": "side",
|
|
"optional": false
|
|
},
|
|
"computed": false,
|
|
"optional": false,
|
|
"init": null,
|
|
"params": [],
|
|
"typeAnnotation": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 1223,
|
|
"end": 1231,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsKeywordType",
|
|
"span": {
|
|
"start": 1225,
|
|
"end": 1231,
|
|
"ctxt": 0
|
|
},
|
|
"kind": "number"
|
|
}
|
|
},
|
|
"typeParams": null
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "TsTypeAliasDeclaration",
|
|
"span": {
|
|
"start": 1236,
|
|
"end": 1288,
|
|
"ctxt": 0
|
|
},
|
|
"declare": false,
|
|
"id": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1241,
|
|
"end": 1246,
|
|
"ctxt": 0
|
|
},
|
|
"value": "Shape",
|
|
"optional": false
|
|
},
|
|
"typeParams": null,
|
|
"typeAnnotation": {
|
|
"type": "TsUnionType",
|
|
"span": {
|
|
"start": 1249,
|
|
"end": 1287,
|
|
"ctxt": 0
|
|
},
|
|
"types": [
|
|
{
|
|
"type": "TsTypeReference",
|
|
"span": {
|
|
"start": 1249,
|
|
"end": 1255,
|
|
"ctxt": 0
|
|
},
|
|
"typeName": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1249,
|
|
"end": 1255,
|
|
"ctxt": 0
|
|
},
|
|
"value": "Square",
|
|
"optional": false
|
|
},
|
|
"typeParams": null
|
|
},
|
|
{
|
|
"type": "TsTypeReference",
|
|
"span": {
|
|
"start": 1258,
|
|
"end": 1267,
|
|
"ctxt": 0
|
|
},
|
|
"typeName": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1258,
|
|
"end": 1267,
|
|
"ctxt": 0
|
|
},
|
|
"value": "Rectangle",
|
|
"optional": false
|
|
},
|
|
"typeParams": null
|
|
},
|
|
{
|
|
"type": "TsTypeReference",
|
|
"span": {
|
|
"start": 1270,
|
|
"end": 1276,
|
|
"ctxt": 0
|
|
},
|
|
"typeName": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1270,
|
|
"end": 1276,
|
|
"ctxt": 0
|
|
},
|
|
"value": "Circle",
|
|
"optional": false
|
|
},
|
|
"typeParams": null
|
|
},
|
|
{
|
|
"type": "TsTypeReference",
|
|
"span": {
|
|
"start": 1279,
|
|
"end": 1287,
|
|
"ctxt": 0
|
|
},
|
|
"typeName": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1279,
|
|
"end": 1287,
|
|
"ctxt": 0
|
|
},
|
|
"value": "Triangle",
|
|
"optional": false
|
|
},
|
|
"typeParams": null
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "FunctionDeclaration",
|
|
"identifier": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1299,
|
|
"end": 1303,
|
|
"ctxt": 0
|
|
},
|
|
"value": "area",
|
|
"optional": false
|
|
},
|
|
"declare": false,
|
|
"params": [
|
|
{
|
|
"type": "Parameter",
|
|
"span": {
|
|
"start": 1304,
|
|
"end": 1312,
|
|
"ctxt": 0
|
|
},
|
|
"decorators": [],
|
|
"pat": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1304,
|
|
"end": 1312,
|
|
"ctxt": 0
|
|
},
|
|
"value": "s",
|
|
"optional": false,
|
|
"typeAnnotation": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 1305,
|
|
"end": 1312,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsTypeReference",
|
|
"span": {
|
|
"start": 1307,
|
|
"end": 1312,
|
|
"ctxt": 0
|
|
},
|
|
"typeName": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1307,
|
|
"end": 1312,
|
|
"ctxt": 0
|
|
},
|
|
"value": "Shape",
|
|
"optional": false
|
|
},
|
|
"typeParams": null
|
|
}
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"decorators": [],
|
|
"span": {
|
|
"start": 1290,
|
|
"end": 1641,
|
|
"ctxt": 0
|
|
},
|
|
"body": {
|
|
"type": "BlockStatement",
|
|
"span": {
|
|
"start": 1322,
|
|
"end": 1641,
|
|
"ctxt": 0
|
|
},
|
|
"stmts": [
|
|
{
|
|
"type": "VariableDeclaration",
|
|
"span": {
|
|
"start": 1328,
|
|
"end": 1337,
|
|
"ctxt": 0
|
|
},
|
|
"kind": "let",
|
|
"declare": false,
|
|
"declarations": [
|
|
{
|
|
"type": "VariableDeclarator",
|
|
"span": {
|
|
"start": 1332,
|
|
"end": 1336,
|
|
"ctxt": 0
|
|
},
|
|
"id": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1332,
|
|
"end": 1336,
|
|
"ctxt": 0
|
|
},
|
|
"value": "area",
|
|
"optional": false,
|
|
"typeAnnotation": null
|
|
},
|
|
"init": null,
|
|
"definite": false
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "SwitchStatement",
|
|
"span": {
|
|
"start": 1342,
|
|
"end": 1622,
|
|
"ctxt": 0
|
|
},
|
|
"discriminant": {
|
|
"type": "MemberExpression",
|
|
"span": {
|
|
"start": 1350,
|
|
"end": 1356,
|
|
"ctxt": 0
|
|
},
|
|
"object": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1350,
|
|
"end": 1351,
|
|
"ctxt": 0
|
|
},
|
|
"value": "s",
|
|
"optional": false
|
|
},
|
|
"property": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1352,
|
|
"end": 1356,
|
|
"ctxt": 0
|
|
},
|
|
"value": "kind",
|
|
"optional": false
|
|
}
|
|
},
|
|
"cases": [
|
|
{
|
|
"type": "SwitchCase",
|
|
"span": {
|
|
"start": 1368,
|
|
"end": 1413,
|
|
"ctxt": 0
|
|
},
|
|
"test": {
|
|
"type": "StringLiteral",
|
|
"span": {
|
|
"start": 1373,
|
|
"end": 1381,
|
|
"ctxt": 0
|
|
},
|
|
"value": "square",
|
|
"hasEscape": false,
|
|
"kind": {
|
|
"type": "normal",
|
|
"containsQuote": true
|
|
}
|
|
},
|
|
"consequent": [
|
|
{
|
|
"type": "ExpressionStatement",
|
|
"span": {
|
|
"start": 1383,
|
|
"end": 1406,
|
|
"ctxt": 0
|
|
},
|
|
"expression": {
|
|
"type": "AssignmentExpression",
|
|
"span": {
|
|
"start": 1383,
|
|
"end": 1405,
|
|
"ctxt": 0
|
|
},
|
|
"operator": "=",
|
|
"left": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1383,
|
|
"end": 1387,
|
|
"ctxt": 0
|
|
},
|
|
"value": "area",
|
|
"optional": false,
|
|
"typeAnnotation": null
|
|
},
|
|
"right": {
|
|
"type": "BinaryExpression",
|
|
"span": {
|
|
"start": 1390,
|
|
"end": 1405,
|
|
"ctxt": 0
|
|
},
|
|
"operator": "*",
|
|
"left": {
|
|
"type": "MemberExpression",
|
|
"span": {
|
|
"start": 1390,
|
|
"end": 1396,
|
|
"ctxt": 0
|
|
},
|
|
"object": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1390,
|
|
"end": 1391,
|
|
"ctxt": 0
|
|
},
|
|
"value": "s",
|
|
"optional": false
|
|
},
|
|
"property": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1392,
|
|
"end": 1396,
|
|
"ctxt": 0
|
|
},
|
|
"value": "size",
|
|
"optional": false
|
|
}
|
|
},
|
|
"right": {
|
|
"type": "MemberExpression",
|
|
"span": {
|
|
"start": 1399,
|
|
"end": 1405,
|
|
"ctxt": 0
|
|
},
|
|
"object": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1399,
|
|
"end": 1400,
|
|
"ctxt": 0
|
|
},
|
|
"value": "s",
|
|
"optional": false
|
|
},
|
|
"property": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1401,
|
|
"end": 1405,
|
|
"ctxt": 0
|
|
},
|
|
"value": "size",
|
|
"optional": false
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"type": "BreakStatement",
|
|
"span": {
|
|
"start": 1407,
|
|
"end": 1413,
|
|
"ctxt": 0
|
|
},
|
|
"label": null
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "SwitchCase",
|
|
"span": {
|
|
"start": 1422,
|
|
"end": 1473,
|
|
"ctxt": 0
|
|
},
|
|
"test": {
|
|
"type": "StringLiteral",
|
|
"span": {
|
|
"start": 1427,
|
|
"end": 1438,
|
|
"ctxt": 0
|
|
},
|
|
"value": "rectangle",
|
|
"hasEscape": false,
|
|
"kind": {
|
|
"type": "normal",
|
|
"containsQuote": true
|
|
}
|
|
},
|
|
"consequent": [
|
|
{
|
|
"type": "ExpressionStatement",
|
|
"span": {
|
|
"start": 1440,
|
|
"end": 1466,
|
|
"ctxt": 0
|
|
},
|
|
"expression": {
|
|
"type": "AssignmentExpression",
|
|
"span": {
|
|
"start": 1440,
|
|
"end": 1465,
|
|
"ctxt": 0
|
|
},
|
|
"operator": "=",
|
|
"left": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1440,
|
|
"end": 1444,
|
|
"ctxt": 0
|
|
},
|
|
"value": "area",
|
|
"optional": false,
|
|
"typeAnnotation": null
|
|
},
|
|
"right": {
|
|
"type": "BinaryExpression",
|
|
"span": {
|
|
"start": 1447,
|
|
"end": 1465,
|
|
"ctxt": 0
|
|
},
|
|
"operator": "*",
|
|
"left": {
|
|
"type": "MemberExpression",
|
|
"span": {
|
|
"start": 1447,
|
|
"end": 1454,
|
|
"ctxt": 0
|
|
},
|
|
"object": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1447,
|
|
"end": 1448,
|
|
"ctxt": 0
|
|
},
|
|
"value": "s",
|
|
"optional": false
|
|
},
|
|
"property": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1449,
|
|
"end": 1454,
|
|
"ctxt": 0
|
|
},
|
|
"value": "width",
|
|
"optional": false
|
|
}
|
|
},
|
|
"right": {
|
|
"type": "MemberExpression",
|
|
"span": {
|
|
"start": 1457,
|
|
"end": 1465,
|
|
"ctxt": 0
|
|
},
|
|
"object": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1457,
|
|
"end": 1458,
|
|
"ctxt": 0
|
|
},
|
|
"value": "s",
|
|
"optional": false
|
|
},
|
|
"property": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1459,
|
|
"end": 1465,
|
|
"ctxt": 0
|
|
},
|
|
"value": "height",
|
|
"optional": false
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"type": "BreakStatement",
|
|
"span": {
|
|
"start": 1467,
|
|
"end": 1473,
|
|
"ctxt": 0
|
|
},
|
|
"label": null
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "SwitchCase",
|
|
"span": {
|
|
"start": 1482,
|
|
"end": 1541,
|
|
"ctxt": 0
|
|
},
|
|
"test": {
|
|
"type": "StringLiteral",
|
|
"span": {
|
|
"start": 1487,
|
|
"end": 1495,
|
|
"ctxt": 0
|
|
},
|
|
"value": "circle",
|
|
"hasEscape": false,
|
|
"kind": {
|
|
"type": "normal",
|
|
"containsQuote": true
|
|
}
|
|
},
|
|
"consequent": [
|
|
{
|
|
"type": "ExpressionStatement",
|
|
"span": {
|
|
"start": 1497,
|
|
"end": 1534,
|
|
"ctxt": 0
|
|
},
|
|
"expression": {
|
|
"type": "AssignmentExpression",
|
|
"span": {
|
|
"start": 1497,
|
|
"end": 1533,
|
|
"ctxt": 0
|
|
},
|
|
"operator": "=",
|
|
"left": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1497,
|
|
"end": 1501,
|
|
"ctxt": 0
|
|
},
|
|
"value": "area",
|
|
"optional": false,
|
|
"typeAnnotation": null
|
|
},
|
|
"right": {
|
|
"type": "BinaryExpression",
|
|
"span": {
|
|
"start": 1504,
|
|
"end": 1533,
|
|
"ctxt": 0
|
|
},
|
|
"operator": "*",
|
|
"left": {
|
|
"type": "BinaryExpression",
|
|
"span": {
|
|
"start": 1504,
|
|
"end": 1522,
|
|
"ctxt": 0
|
|
},
|
|
"operator": "*",
|
|
"left": {
|
|
"type": "MemberExpression",
|
|
"span": {
|
|
"start": 1504,
|
|
"end": 1511,
|
|
"ctxt": 0
|
|
},
|
|
"object": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1504,
|
|
"end": 1508,
|
|
"ctxt": 0
|
|
},
|
|
"value": "Math",
|
|
"optional": false
|
|
},
|
|
"property": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1509,
|
|
"end": 1511,
|
|
"ctxt": 0
|
|
},
|
|
"value": "PI",
|
|
"optional": false
|
|
}
|
|
},
|
|
"right": {
|
|
"type": "MemberExpression",
|
|
"span": {
|
|
"start": 1514,
|
|
"end": 1522,
|
|
"ctxt": 0
|
|
},
|
|
"object": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1514,
|
|
"end": 1515,
|
|
"ctxt": 0
|
|
},
|
|
"value": "s",
|
|
"optional": false
|
|
},
|
|
"property": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1516,
|
|
"end": 1522,
|
|
"ctxt": 0
|
|
},
|
|
"value": "radius",
|
|
"optional": false
|
|
}
|
|
}
|
|
},
|
|
"right": {
|
|
"type": "MemberExpression",
|
|
"span": {
|
|
"start": 1525,
|
|
"end": 1533,
|
|
"ctxt": 0
|
|
},
|
|
"object": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1525,
|
|
"end": 1526,
|
|
"ctxt": 0
|
|
},
|
|
"value": "s",
|
|
"optional": false
|
|
},
|
|
"property": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1527,
|
|
"end": 1533,
|
|
"ctxt": 0
|
|
},
|
|
"value": "radius",
|
|
"optional": false
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"type": "BreakStatement",
|
|
"span": {
|
|
"start": 1535,
|
|
"end": 1541,
|
|
"ctxt": 0
|
|
},
|
|
"label": null
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "SwitchCase",
|
|
"span": {
|
|
"start": 1550,
|
|
"end": 1616,
|
|
"ctxt": 0
|
|
},
|
|
"test": {
|
|
"type": "StringLiteral",
|
|
"span": {
|
|
"start": 1555,
|
|
"end": 1565,
|
|
"ctxt": 0
|
|
},
|
|
"value": "triangle",
|
|
"hasEscape": false,
|
|
"kind": {
|
|
"type": "normal",
|
|
"containsQuote": true
|
|
}
|
|
},
|
|
"consequent": [
|
|
{
|
|
"type": "ExpressionStatement",
|
|
"span": {
|
|
"start": 1567,
|
|
"end": 1609,
|
|
"ctxt": 0
|
|
},
|
|
"expression": {
|
|
"type": "AssignmentExpression",
|
|
"span": {
|
|
"start": 1567,
|
|
"end": 1608,
|
|
"ctxt": 0
|
|
},
|
|
"operator": "=",
|
|
"left": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1567,
|
|
"end": 1571,
|
|
"ctxt": 0
|
|
},
|
|
"value": "area",
|
|
"optional": false,
|
|
"typeAnnotation": null
|
|
},
|
|
"right": {
|
|
"type": "BinaryExpression",
|
|
"span": {
|
|
"start": 1574,
|
|
"end": 1608,
|
|
"ctxt": 0
|
|
},
|
|
"operator": "*",
|
|
"left": {
|
|
"type": "BinaryExpression",
|
|
"span": {
|
|
"start": 1574,
|
|
"end": 1599,
|
|
"ctxt": 0
|
|
},
|
|
"operator": "*",
|
|
"left": {
|
|
"type": "BinaryExpression",
|
|
"span": {
|
|
"start": 1574,
|
|
"end": 1590,
|
|
"ctxt": 0
|
|
},
|
|
"operator": "/",
|
|
"left": {
|
|
"type": "CallExpression",
|
|
"span": {
|
|
"start": 1574,
|
|
"end": 1586,
|
|
"ctxt": 0
|
|
},
|
|
"callee": {
|
|
"type": "MemberExpression",
|
|
"span": {
|
|
"start": 1574,
|
|
"end": 1583,
|
|
"ctxt": 0
|
|
},
|
|
"object": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1574,
|
|
"end": 1578,
|
|
"ctxt": 0
|
|
},
|
|
"value": "Math",
|
|
"optional": false
|
|
},
|
|
"property": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1579,
|
|
"end": 1583,
|
|
"ctxt": 0
|
|
},
|
|
"value": "sqrt",
|
|
"optional": false
|
|
}
|
|
},
|
|
"arguments": [
|
|
{
|
|
"spread": null,
|
|
"expression": {
|
|
"type": "NumericLiteral",
|
|
"span": {
|
|
"start": 1584,
|
|
"end": 1585,
|
|
"ctxt": 0
|
|
},
|
|
"value": 3.0
|
|
}
|
|
}
|
|
],
|
|
"typeArguments": null
|
|
},
|
|
"right": {
|
|
"type": "NumericLiteral",
|
|
"span": {
|
|
"start": 1589,
|
|
"end": 1590,
|
|
"ctxt": 0
|
|
},
|
|
"value": 4.0
|
|
}
|
|
},
|
|
"right": {
|
|
"type": "MemberExpression",
|
|
"span": {
|
|
"start": 1593,
|
|
"end": 1599,
|
|
"ctxt": 0
|
|
},
|
|
"object": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1593,
|
|
"end": 1594,
|
|
"ctxt": 0
|
|
},
|
|
"value": "s",
|
|
"optional": false
|
|
},
|
|
"property": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1595,
|
|
"end": 1599,
|
|
"ctxt": 0
|
|
},
|
|
"value": "side",
|
|
"optional": false
|
|
}
|
|
}
|
|
},
|
|
"right": {
|
|
"type": "MemberExpression",
|
|
"span": {
|
|
"start": 1602,
|
|
"end": 1608,
|
|
"ctxt": 0
|
|
},
|
|
"object": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1602,
|
|
"end": 1603,
|
|
"ctxt": 0
|
|
},
|
|
"value": "s",
|
|
"optional": false
|
|
},
|
|
"property": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1604,
|
|
"end": 1608,
|
|
"ctxt": 0
|
|
},
|
|
"value": "side",
|
|
"optional": false
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"type": "BreakStatement",
|
|
"span": {
|
|
"start": 1610,
|
|
"end": 1616,
|
|
"ctxt": 0
|
|
},
|
|
"label": null
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "ReturnStatement",
|
|
"span": {
|
|
"start": 1627,
|
|
"end": 1639,
|
|
"ctxt": 0
|
|
},
|
|
"argument": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1634,
|
|
"end": 1638,
|
|
"ctxt": 0
|
|
},
|
|
"value": "area",
|
|
"optional": false
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"generator": false,
|
|
"async": false,
|
|
"typeParameters": null,
|
|
"returnType": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 1313,
|
|
"end": 1321,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsKeywordType",
|
|
"span": {
|
|
"start": 1315,
|
|
"end": 1321,
|
|
"ctxt": 0
|
|
},
|
|
"kind": "number"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"type": "FunctionDeclaration",
|
|
"identifier": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1652,
|
|
"end": 1663,
|
|
"ctxt": 0
|
|
},
|
|
"value": "areaWrapped",
|
|
"optional": false
|
|
},
|
|
"declare": false,
|
|
"params": [
|
|
{
|
|
"type": "Parameter",
|
|
"span": {
|
|
"start": 1664,
|
|
"end": 1672,
|
|
"ctxt": 0
|
|
},
|
|
"decorators": [],
|
|
"pat": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1664,
|
|
"end": 1672,
|
|
"ctxt": 0
|
|
},
|
|
"value": "s",
|
|
"optional": false,
|
|
"typeAnnotation": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 1665,
|
|
"end": 1672,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsTypeReference",
|
|
"span": {
|
|
"start": 1667,
|
|
"end": 1672,
|
|
"ctxt": 0
|
|
},
|
|
"typeName": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1667,
|
|
"end": 1672,
|
|
"ctxt": 0
|
|
},
|
|
"value": "Shape",
|
|
"optional": false
|
|
},
|
|
"typeParams": null
|
|
}
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"decorators": [],
|
|
"span": {
|
|
"start": 1643,
|
|
"end": 2027,
|
|
"ctxt": 0
|
|
},
|
|
"body": {
|
|
"type": "BlockStatement",
|
|
"span": {
|
|
"start": 1682,
|
|
"end": 2027,
|
|
"ctxt": 0
|
|
},
|
|
"stmts": [
|
|
{
|
|
"type": "VariableDeclaration",
|
|
"span": {
|
|
"start": 1688,
|
|
"end": 1697,
|
|
"ctxt": 0
|
|
},
|
|
"kind": "let",
|
|
"declare": false,
|
|
"declarations": [
|
|
{
|
|
"type": "VariableDeclarator",
|
|
"span": {
|
|
"start": 1692,
|
|
"end": 1696,
|
|
"ctxt": 0
|
|
},
|
|
"id": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1692,
|
|
"end": 1696,
|
|
"ctxt": 0
|
|
},
|
|
"value": "area",
|
|
"optional": false,
|
|
"typeAnnotation": null
|
|
},
|
|
"init": null,
|
|
"definite": false
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "ExpressionStatement",
|
|
"span": {
|
|
"start": 1702,
|
|
"end": 2008,
|
|
"ctxt": 0
|
|
},
|
|
"expression": {
|
|
"type": "AssignmentExpression",
|
|
"span": {
|
|
"start": 1702,
|
|
"end": 2007,
|
|
"ctxt": 0
|
|
},
|
|
"operator": "=",
|
|
"left": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1702,
|
|
"end": 1706,
|
|
"ctxt": 0
|
|
},
|
|
"value": "area",
|
|
"optional": false,
|
|
"typeAnnotation": null
|
|
},
|
|
"right": {
|
|
"type": "CallExpression",
|
|
"span": {
|
|
"start": 1709,
|
|
"end": 2007,
|
|
"ctxt": 0
|
|
},
|
|
"callee": {
|
|
"type": "ParenthesisExpression",
|
|
"span": {
|
|
"start": 1709,
|
|
"end": 2005,
|
|
"ctxt": 0
|
|
},
|
|
"expression": {
|
|
"type": "ArrowFunctionExpression",
|
|
"span": {
|
|
"start": 1710,
|
|
"end": 2004,
|
|
"ctxt": 0
|
|
},
|
|
"params": [],
|
|
"body": {
|
|
"type": "BlockStatement",
|
|
"span": {
|
|
"start": 1716,
|
|
"end": 2004,
|
|
"ctxt": 0
|
|
},
|
|
"stmts": [
|
|
{
|
|
"type": "SwitchStatement",
|
|
"span": {
|
|
"start": 1726,
|
|
"end": 1998,
|
|
"ctxt": 0
|
|
},
|
|
"discriminant": {
|
|
"type": "MemberExpression",
|
|
"span": {
|
|
"start": 1734,
|
|
"end": 1740,
|
|
"ctxt": 0
|
|
},
|
|
"object": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1734,
|
|
"end": 1735,
|
|
"ctxt": 0
|
|
},
|
|
"value": "s",
|
|
"optional": false
|
|
},
|
|
"property": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1736,
|
|
"end": 1740,
|
|
"ctxt": 0
|
|
},
|
|
"value": "kind",
|
|
"optional": false
|
|
}
|
|
},
|
|
"cases": [
|
|
{
|
|
"type": "SwitchCase",
|
|
"span": {
|
|
"start": 1756,
|
|
"end": 1794,
|
|
"ctxt": 0
|
|
},
|
|
"test": {
|
|
"type": "StringLiteral",
|
|
"span": {
|
|
"start": 1761,
|
|
"end": 1769,
|
|
"ctxt": 0
|
|
},
|
|
"value": "square",
|
|
"hasEscape": false,
|
|
"kind": {
|
|
"type": "normal",
|
|
"containsQuote": true
|
|
}
|
|
},
|
|
"consequent": [
|
|
{
|
|
"type": "ReturnStatement",
|
|
"span": {
|
|
"start": 1771,
|
|
"end": 1794,
|
|
"ctxt": 0
|
|
},
|
|
"argument": {
|
|
"type": "BinaryExpression",
|
|
"span": {
|
|
"start": 1778,
|
|
"end": 1793,
|
|
"ctxt": 0
|
|
},
|
|
"operator": "*",
|
|
"left": {
|
|
"type": "MemberExpression",
|
|
"span": {
|
|
"start": 1778,
|
|
"end": 1784,
|
|
"ctxt": 0
|
|
},
|
|
"object": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1778,
|
|
"end": 1779,
|
|
"ctxt": 0
|
|
},
|
|
"value": "s",
|
|
"optional": false
|
|
},
|
|
"property": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1780,
|
|
"end": 1784,
|
|
"ctxt": 0
|
|
},
|
|
"value": "size",
|
|
"optional": false
|
|
}
|
|
},
|
|
"right": {
|
|
"type": "MemberExpression",
|
|
"span": {
|
|
"start": 1787,
|
|
"end": 1793,
|
|
"ctxt": 0
|
|
},
|
|
"object": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1787,
|
|
"end": 1788,
|
|
"ctxt": 0
|
|
},
|
|
"value": "s",
|
|
"optional": false
|
|
},
|
|
"property": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1789,
|
|
"end": 1793,
|
|
"ctxt": 0
|
|
},
|
|
"value": "size",
|
|
"optional": false
|
|
}
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "SwitchCase",
|
|
"span": {
|
|
"start": 1807,
|
|
"end": 1851,
|
|
"ctxt": 0
|
|
},
|
|
"test": {
|
|
"type": "StringLiteral",
|
|
"span": {
|
|
"start": 1812,
|
|
"end": 1823,
|
|
"ctxt": 0
|
|
},
|
|
"value": "rectangle",
|
|
"hasEscape": false,
|
|
"kind": {
|
|
"type": "normal",
|
|
"containsQuote": true
|
|
}
|
|
},
|
|
"consequent": [
|
|
{
|
|
"type": "ReturnStatement",
|
|
"span": {
|
|
"start": 1825,
|
|
"end": 1851,
|
|
"ctxt": 0
|
|
},
|
|
"argument": {
|
|
"type": "BinaryExpression",
|
|
"span": {
|
|
"start": 1832,
|
|
"end": 1850,
|
|
"ctxt": 0
|
|
},
|
|
"operator": "*",
|
|
"left": {
|
|
"type": "MemberExpression",
|
|
"span": {
|
|
"start": 1832,
|
|
"end": 1839,
|
|
"ctxt": 0
|
|
},
|
|
"object": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1832,
|
|
"end": 1833,
|
|
"ctxt": 0
|
|
},
|
|
"value": "s",
|
|
"optional": false
|
|
},
|
|
"property": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1834,
|
|
"end": 1839,
|
|
"ctxt": 0
|
|
},
|
|
"value": "width",
|
|
"optional": false
|
|
}
|
|
},
|
|
"right": {
|
|
"type": "MemberExpression",
|
|
"span": {
|
|
"start": 1842,
|
|
"end": 1850,
|
|
"ctxt": 0
|
|
},
|
|
"object": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1842,
|
|
"end": 1843,
|
|
"ctxt": 0
|
|
},
|
|
"value": "s",
|
|
"optional": false
|
|
},
|
|
"property": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1844,
|
|
"end": 1850,
|
|
"ctxt": 0
|
|
},
|
|
"value": "height",
|
|
"optional": false
|
|
}
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "SwitchCase",
|
|
"span": {
|
|
"start": 1864,
|
|
"end": 1916,
|
|
"ctxt": 0
|
|
},
|
|
"test": {
|
|
"type": "StringLiteral",
|
|
"span": {
|
|
"start": 1869,
|
|
"end": 1877,
|
|
"ctxt": 0
|
|
},
|
|
"value": "circle",
|
|
"hasEscape": false,
|
|
"kind": {
|
|
"type": "normal",
|
|
"containsQuote": true
|
|
}
|
|
},
|
|
"consequent": [
|
|
{
|
|
"type": "ReturnStatement",
|
|
"span": {
|
|
"start": 1879,
|
|
"end": 1916,
|
|
"ctxt": 0
|
|
},
|
|
"argument": {
|
|
"type": "BinaryExpression",
|
|
"span": {
|
|
"start": 1886,
|
|
"end": 1915,
|
|
"ctxt": 0
|
|
},
|
|
"operator": "*",
|
|
"left": {
|
|
"type": "BinaryExpression",
|
|
"span": {
|
|
"start": 1886,
|
|
"end": 1904,
|
|
"ctxt": 0
|
|
},
|
|
"operator": "*",
|
|
"left": {
|
|
"type": "MemberExpression",
|
|
"span": {
|
|
"start": 1886,
|
|
"end": 1893,
|
|
"ctxt": 0
|
|
},
|
|
"object": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1886,
|
|
"end": 1890,
|
|
"ctxt": 0
|
|
},
|
|
"value": "Math",
|
|
"optional": false
|
|
},
|
|
"property": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1891,
|
|
"end": 1893,
|
|
"ctxt": 0
|
|
},
|
|
"value": "PI",
|
|
"optional": false
|
|
}
|
|
},
|
|
"right": {
|
|
"type": "MemberExpression",
|
|
"span": {
|
|
"start": 1896,
|
|
"end": 1904,
|
|
"ctxt": 0
|
|
},
|
|
"object": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1896,
|
|
"end": 1897,
|
|
"ctxt": 0
|
|
},
|
|
"value": "s",
|
|
"optional": false
|
|
},
|
|
"property": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1898,
|
|
"end": 1904,
|
|
"ctxt": 0
|
|
},
|
|
"value": "radius",
|
|
"optional": false
|
|
}
|
|
}
|
|
},
|
|
"right": {
|
|
"type": "MemberExpression",
|
|
"span": {
|
|
"start": 1907,
|
|
"end": 1915,
|
|
"ctxt": 0
|
|
},
|
|
"object": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1907,
|
|
"end": 1908,
|
|
"ctxt": 0
|
|
},
|
|
"value": "s",
|
|
"optional": false
|
|
},
|
|
"property": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1909,
|
|
"end": 1915,
|
|
"ctxt": 0
|
|
},
|
|
"value": "radius",
|
|
"optional": false
|
|
}
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "SwitchCase",
|
|
"span": {
|
|
"start": 1929,
|
|
"end": 1988,
|
|
"ctxt": 0
|
|
},
|
|
"test": {
|
|
"type": "StringLiteral",
|
|
"span": {
|
|
"start": 1934,
|
|
"end": 1944,
|
|
"ctxt": 0
|
|
},
|
|
"value": "triangle",
|
|
"hasEscape": false,
|
|
"kind": {
|
|
"type": "normal",
|
|
"containsQuote": true
|
|
}
|
|
},
|
|
"consequent": [
|
|
{
|
|
"type": "ReturnStatement",
|
|
"span": {
|
|
"start": 1946,
|
|
"end": 1988,
|
|
"ctxt": 0
|
|
},
|
|
"argument": {
|
|
"type": "BinaryExpression",
|
|
"span": {
|
|
"start": 1953,
|
|
"end": 1987,
|
|
"ctxt": 0
|
|
},
|
|
"operator": "*",
|
|
"left": {
|
|
"type": "BinaryExpression",
|
|
"span": {
|
|
"start": 1953,
|
|
"end": 1978,
|
|
"ctxt": 0
|
|
},
|
|
"operator": "*",
|
|
"left": {
|
|
"type": "BinaryExpression",
|
|
"span": {
|
|
"start": 1953,
|
|
"end": 1969,
|
|
"ctxt": 0
|
|
},
|
|
"operator": "/",
|
|
"left": {
|
|
"type": "CallExpression",
|
|
"span": {
|
|
"start": 1953,
|
|
"end": 1965,
|
|
"ctxt": 0
|
|
},
|
|
"callee": {
|
|
"type": "MemberExpression",
|
|
"span": {
|
|
"start": 1953,
|
|
"end": 1962,
|
|
"ctxt": 0
|
|
},
|
|
"object": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1953,
|
|
"end": 1957,
|
|
"ctxt": 0
|
|
},
|
|
"value": "Math",
|
|
"optional": false
|
|
},
|
|
"property": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1958,
|
|
"end": 1962,
|
|
"ctxt": 0
|
|
},
|
|
"value": "sqrt",
|
|
"optional": false
|
|
}
|
|
},
|
|
"arguments": [
|
|
{
|
|
"spread": null,
|
|
"expression": {
|
|
"type": "NumericLiteral",
|
|
"span": {
|
|
"start": 1963,
|
|
"end": 1964,
|
|
"ctxt": 0
|
|
},
|
|
"value": 3.0
|
|
}
|
|
}
|
|
],
|
|
"typeArguments": null
|
|
},
|
|
"right": {
|
|
"type": "NumericLiteral",
|
|
"span": {
|
|
"start": 1968,
|
|
"end": 1969,
|
|
"ctxt": 0
|
|
},
|
|
"value": 4.0
|
|
}
|
|
},
|
|
"right": {
|
|
"type": "MemberExpression",
|
|
"span": {
|
|
"start": 1972,
|
|
"end": 1978,
|
|
"ctxt": 0
|
|
},
|
|
"object": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1972,
|
|
"end": 1973,
|
|
"ctxt": 0
|
|
},
|
|
"value": "s",
|
|
"optional": false
|
|
},
|
|
"property": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1974,
|
|
"end": 1978,
|
|
"ctxt": 0
|
|
},
|
|
"value": "side",
|
|
"optional": false
|
|
}
|
|
}
|
|
},
|
|
"right": {
|
|
"type": "MemberExpression",
|
|
"span": {
|
|
"start": 1981,
|
|
"end": 1987,
|
|
"ctxt": 0
|
|
},
|
|
"object": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1981,
|
|
"end": 1982,
|
|
"ctxt": 0
|
|
},
|
|
"value": "s",
|
|
"optional": false
|
|
},
|
|
"property": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 1983,
|
|
"end": 1987,
|
|
"ctxt": 0
|
|
},
|
|
"value": "side",
|
|
"optional": false
|
|
}
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"async": false,
|
|
"generator": false,
|
|
"typeParameters": null,
|
|
"returnType": null
|
|
}
|
|
},
|
|
"arguments": [],
|
|
"typeArguments": null
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"type": "ReturnStatement",
|
|
"span": {
|
|
"start": 2013,
|
|
"end": 2025,
|
|
"ctxt": 0
|
|
},
|
|
"argument": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 2020,
|
|
"end": 2024,
|
|
"ctxt": 0
|
|
},
|
|
"value": "area",
|
|
"optional": false
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"generator": false,
|
|
"async": false,
|
|
"typeParameters": null,
|
|
"returnType": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 1673,
|
|
"end": 1681,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsKeywordType",
|
|
"span": {
|
|
"start": 1675,
|
|
"end": 1681,
|
|
"ctxt": 0
|
|
},
|
|
"kind": "number"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"type": "TsEnumDeclaration",
|
|
"span": {
|
|
"start": 2051,
|
|
"end": 2073,
|
|
"ctxt": 0
|
|
},
|
|
"declare": false,
|
|
"isConst": false,
|
|
"id": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 2056,
|
|
"end": 2062,
|
|
"ctxt": 0
|
|
},
|
|
"value": "MyEnum",
|
|
"optional": false
|
|
},
|
|
"members": [
|
|
{
|
|
"type": "TsEnumMember",
|
|
"span": {
|
|
"start": 2066,
|
|
"end": 2067,
|
|
"ctxt": 0
|
|
},
|
|
"id": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 2066,
|
|
"end": 2067,
|
|
"ctxt": 0
|
|
},
|
|
"value": "A",
|
|
"optional": false
|
|
},
|
|
"init": null
|
|
},
|
|
{
|
|
"type": "TsEnumMember",
|
|
"span": {
|
|
"start": 2070,
|
|
"end": 2071,
|
|
"ctxt": 0
|
|
},
|
|
"id": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 2070,
|
|
"end": 2071,
|
|
"ctxt": 0
|
|
},
|
|
"value": "B",
|
|
"optional": false
|
|
},
|
|
"init": null
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "FunctionDeclaration",
|
|
"identifier": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 2084,
|
|
"end": 2098,
|
|
"ctxt": 0
|
|
},
|
|
"value": "thisGivesError",
|
|
"optional": false
|
|
},
|
|
"declare": false,
|
|
"params": [
|
|
{
|
|
"type": "Parameter",
|
|
"span": {
|
|
"start": 2099,
|
|
"end": 2108,
|
|
"ctxt": 0
|
|
},
|
|
"decorators": [],
|
|
"pat": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 2099,
|
|
"end": 2108,
|
|
"ctxt": 0
|
|
},
|
|
"value": "e",
|
|
"optional": false,
|
|
"typeAnnotation": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 2100,
|
|
"end": 2108,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsTypeReference",
|
|
"span": {
|
|
"start": 2102,
|
|
"end": 2108,
|
|
"ctxt": 0
|
|
},
|
|
"typeName": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 2102,
|
|
"end": 2108,
|
|
"ctxt": 0
|
|
},
|
|
"value": "MyEnum",
|
|
"optional": false
|
|
},
|
|
"typeParams": null
|
|
}
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"decorators": [],
|
|
"span": {
|
|
"start": 2075,
|
|
"end": 2245,
|
|
"ctxt": 0
|
|
},
|
|
"body": {
|
|
"type": "BlockStatement",
|
|
"span": {
|
|
"start": 2118,
|
|
"end": 2245,
|
|
"ctxt": 0
|
|
},
|
|
"stmts": [
|
|
{
|
|
"type": "VariableDeclaration",
|
|
"span": {
|
|
"start": 2121,
|
|
"end": 2135,
|
|
"ctxt": 0
|
|
},
|
|
"kind": "let",
|
|
"declare": false,
|
|
"declarations": [
|
|
{
|
|
"type": "VariableDeclarator",
|
|
"span": {
|
|
"start": 2125,
|
|
"end": 2134,
|
|
"ctxt": 0
|
|
},
|
|
"id": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 2125,
|
|
"end": 2126,
|
|
"ctxt": 0
|
|
},
|
|
"value": "s",
|
|
"optional": false,
|
|
"typeAnnotation": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 2126,
|
|
"end": 2134,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsKeywordType",
|
|
"span": {
|
|
"start": 2128,
|
|
"end": 2134,
|
|
"ctxt": 0
|
|
},
|
|
"kind": "string"
|
|
}
|
|
}
|
|
},
|
|
"init": null,
|
|
"definite": false
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "SwitchStatement",
|
|
"span": {
|
|
"start": 2137,
|
|
"end": 2232,
|
|
"ctxt": 0
|
|
},
|
|
"discriminant": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 2145,
|
|
"end": 2146,
|
|
"ctxt": 0
|
|
},
|
|
"value": "e",
|
|
"optional": false
|
|
},
|
|
"cases": [
|
|
{
|
|
"type": "SwitchCase",
|
|
"span": {
|
|
"start": 2152,
|
|
"end": 2189,
|
|
"ctxt": 0
|
|
},
|
|
"test": {
|
|
"type": "MemberExpression",
|
|
"span": {
|
|
"start": 2157,
|
|
"end": 2165,
|
|
"ctxt": 0
|
|
},
|
|
"object": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 2157,
|
|
"end": 2163,
|
|
"ctxt": 0
|
|
},
|
|
"value": "MyEnum",
|
|
"optional": false
|
|
},
|
|
"property": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 2164,
|
|
"end": 2165,
|
|
"ctxt": 0
|
|
},
|
|
"value": "A",
|
|
"optional": false
|
|
}
|
|
},
|
|
"consequent": [
|
|
{
|
|
"type": "ExpressionStatement",
|
|
"span": {
|
|
"start": 2167,
|
|
"end": 2182,
|
|
"ctxt": 0
|
|
},
|
|
"expression": {
|
|
"type": "AssignmentExpression",
|
|
"span": {
|
|
"start": 2167,
|
|
"end": 2181,
|
|
"ctxt": 0
|
|
},
|
|
"operator": "=",
|
|
"left": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 2167,
|
|
"end": 2168,
|
|
"ctxt": 0
|
|
},
|
|
"value": "s",
|
|
"optional": false,
|
|
"typeAnnotation": null
|
|
},
|
|
"right": {
|
|
"type": "StringLiteral",
|
|
"span": {
|
|
"start": 2171,
|
|
"end": 2181,
|
|
"ctxt": 0
|
|
},
|
|
"value": "it was A",
|
|
"hasEscape": false,
|
|
"kind": {
|
|
"type": "normal",
|
|
"containsQuote": true
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"type": "BreakStatement",
|
|
"span": {
|
|
"start": 2183,
|
|
"end": 2189,
|
|
"ctxt": 0
|
|
},
|
|
"label": null
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "SwitchCase",
|
|
"span": {
|
|
"start": 2192,
|
|
"end": 2229,
|
|
"ctxt": 0
|
|
},
|
|
"test": {
|
|
"type": "MemberExpression",
|
|
"span": {
|
|
"start": 2197,
|
|
"end": 2205,
|
|
"ctxt": 0
|
|
},
|
|
"object": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 2197,
|
|
"end": 2203,
|
|
"ctxt": 0
|
|
},
|
|
"value": "MyEnum",
|
|
"optional": false
|
|
},
|
|
"property": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 2204,
|
|
"end": 2205,
|
|
"ctxt": 0
|
|
},
|
|
"value": "B",
|
|
"optional": false
|
|
}
|
|
},
|
|
"consequent": [
|
|
{
|
|
"type": "ExpressionStatement",
|
|
"span": {
|
|
"start": 2207,
|
|
"end": 2222,
|
|
"ctxt": 0
|
|
},
|
|
"expression": {
|
|
"type": "AssignmentExpression",
|
|
"span": {
|
|
"start": 2207,
|
|
"end": 2221,
|
|
"ctxt": 0
|
|
},
|
|
"operator": "=",
|
|
"left": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 2207,
|
|
"end": 2208,
|
|
"ctxt": 0
|
|
},
|
|
"value": "s",
|
|
"optional": false,
|
|
"typeAnnotation": null
|
|
},
|
|
"right": {
|
|
"type": "StringLiteral",
|
|
"span": {
|
|
"start": 2211,
|
|
"end": 2221,
|
|
"ctxt": 0
|
|
},
|
|
"value": "it was B",
|
|
"hasEscape": false,
|
|
"kind": {
|
|
"type": "normal",
|
|
"containsQuote": true
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"type": "BreakStatement",
|
|
"span": {
|
|
"start": 2223,
|
|
"end": 2229,
|
|
"ctxt": 0
|
|
},
|
|
"label": null
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "ReturnStatement",
|
|
"span": {
|
|
"start": 2234,
|
|
"end": 2243,
|
|
"ctxt": 0
|
|
},
|
|
"argument": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 2241,
|
|
"end": 2242,
|
|
"ctxt": 0
|
|
},
|
|
"value": "s",
|
|
"optional": false
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"generator": false,
|
|
"async": false,
|
|
"typeParameters": null,
|
|
"returnType": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 2109,
|
|
"end": 2117,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsKeywordType",
|
|
"span": {
|
|
"start": 2111,
|
|
"end": 2117,
|
|
"ctxt": 0
|
|
},
|
|
"kind": "string"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"type": "FunctionDeclaration",
|
|
"identifier": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 2256,
|
|
"end": 2261,
|
|
"ctxt": 0
|
|
},
|
|
"value": "good1",
|
|
"optional": false
|
|
},
|
|
"declare": false,
|
|
"params": [
|
|
{
|
|
"type": "Parameter",
|
|
"span": {
|
|
"start": 2262,
|
|
"end": 2271,
|
|
"ctxt": 0
|
|
},
|
|
"decorators": [],
|
|
"pat": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 2262,
|
|
"end": 2271,
|
|
"ctxt": 0
|
|
},
|
|
"value": "e",
|
|
"optional": false,
|
|
"typeAnnotation": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 2263,
|
|
"end": 2271,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsTypeReference",
|
|
"span": {
|
|
"start": 2265,
|
|
"end": 2271,
|
|
"ctxt": 0
|
|
},
|
|
"typeName": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 2265,
|
|
"end": 2271,
|
|
"ctxt": 0
|
|
},
|
|
"value": "MyEnum",
|
|
"optional": false
|
|
},
|
|
"typeParams": null
|
|
}
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"decorators": [],
|
|
"span": {
|
|
"start": 2247,
|
|
"end": 2455,
|
|
"ctxt": 0
|
|
},
|
|
"body": {
|
|
"type": "BlockStatement",
|
|
"span": {
|
|
"start": 2281,
|
|
"end": 2455,
|
|
"ctxt": 0
|
|
},
|
|
"stmts": [
|
|
{
|
|
"type": "VariableDeclaration",
|
|
"span": {
|
|
"start": 2284,
|
|
"end": 2298,
|
|
"ctxt": 0
|
|
},
|
|
"kind": "let",
|
|
"declare": false,
|
|
"declarations": [
|
|
{
|
|
"type": "VariableDeclarator",
|
|
"span": {
|
|
"start": 2288,
|
|
"end": 2297,
|
|
"ctxt": 0
|
|
},
|
|
"id": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 2288,
|
|
"end": 2289,
|
|
"ctxt": 0
|
|
},
|
|
"value": "s",
|
|
"optional": false,
|
|
"typeAnnotation": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 2289,
|
|
"end": 2297,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsKeywordType",
|
|
"span": {
|
|
"start": 2291,
|
|
"end": 2297,
|
|
"ctxt": 0
|
|
},
|
|
"kind": "string"
|
|
}
|
|
}
|
|
},
|
|
"init": null,
|
|
"definite": false
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "SwitchStatement",
|
|
"span": {
|
|
"start": 2300,
|
|
"end": 2442,
|
|
"ctxt": 0
|
|
},
|
|
"discriminant": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 2308,
|
|
"end": 2309,
|
|
"ctxt": 0
|
|
},
|
|
"value": "e",
|
|
"optional": false
|
|
},
|
|
"cases": [
|
|
{
|
|
"type": "SwitchCase",
|
|
"span": {
|
|
"start": 2315,
|
|
"end": 2352,
|
|
"ctxt": 0
|
|
},
|
|
"test": {
|
|
"type": "MemberExpression",
|
|
"span": {
|
|
"start": 2320,
|
|
"end": 2328,
|
|
"ctxt": 0
|
|
},
|
|
"object": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 2320,
|
|
"end": 2326,
|
|
"ctxt": 0
|
|
},
|
|
"value": "MyEnum",
|
|
"optional": false
|
|
},
|
|
"property": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 2327,
|
|
"end": 2328,
|
|
"ctxt": 0
|
|
},
|
|
"value": "A",
|
|
"optional": false
|
|
}
|
|
},
|
|
"consequent": [
|
|
{
|
|
"type": "ExpressionStatement",
|
|
"span": {
|
|
"start": 2330,
|
|
"end": 2345,
|
|
"ctxt": 0
|
|
},
|
|
"expression": {
|
|
"type": "AssignmentExpression",
|
|
"span": {
|
|
"start": 2330,
|
|
"end": 2344,
|
|
"ctxt": 0
|
|
},
|
|
"operator": "=",
|
|
"left": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 2330,
|
|
"end": 2331,
|
|
"ctxt": 0
|
|
},
|
|
"value": "s",
|
|
"optional": false,
|
|
"typeAnnotation": null
|
|
},
|
|
"right": {
|
|
"type": "StringLiteral",
|
|
"span": {
|
|
"start": 2334,
|
|
"end": 2344,
|
|
"ctxt": 0
|
|
},
|
|
"value": "it was A",
|
|
"hasEscape": false,
|
|
"kind": {
|
|
"type": "normal",
|
|
"containsQuote": true
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"type": "BreakStatement",
|
|
"span": {
|
|
"start": 2346,
|
|
"end": 2352,
|
|
"ctxt": 0
|
|
},
|
|
"label": null
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "SwitchCase",
|
|
"span": {
|
|
"start": 2355,
|
|
"end": 2392,
|
|
"ctxt": 0
|
|
},
|
|
"test": {
|
|
"type": "MemberExpression",
|
|
"span": {
|
|
"start": 2360,
|
|
"end": 2368,
|
|
"ctxt": 0
|
|
},
|
|
"object": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 2360,
|
|
"end": 2366,
|
|
"ctxt": 0
|
|
},
|
|
"value": "MyEnum",
|
|
"optional": false
|
|
},
|
|
"property": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 2367,
|
|
"end": 2368,
|
|
"ctxt": 0
|
|
},
|
|
"value": "B",
|
|
"optional": false
|
|
}
|
|
},
|
|
"consequent": [
|
|
{
|
|
"type": "ExpressionStatement",
|
|
"span": {
|
|
"start": 2370,
|
|
"end": 2385,
|
|
"ctxt": 0
|
|
},
|
|
"expression": {
|
|
"type": "AssignmentExpression",
|
|
"span": {
|
|
"start": 2370,
|
|
"end": 2384,
|
|
"ctxt": 0
|
|
},
|
|
"operator": "=",
|
|
"left": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 2370,
|
|
"end": 2371,
|
|
"ctxt": 0
|
|
},
|
|
"value": "s",
|
|
"optional": false,
|
|
"typeAnnotation": null
|
|
},
|
|
"right": {
|
|
"type": "StringLiteral",
|
|
"span": {
|
|
"start": 2374,
|
|
"end": 2384,
|
|
"ctxt": 0
|
|
},
|
|
"value": "it was B",
|
|
"hasEscape": false,
|
|
"kind": {
|
|
"type": "normal",
|
|
"containsQuote": true
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"type": "BreakStatement",
|
|
"span": {
|
|
"start": 2386,
|
|
"end": 2392,
|
|
"ctxt": 0
|
|
},
|
|
"label": null
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "SwitchCase",
|
|
"span": {
|
|
"start": 2395,
|
|
"end": 2439,
|
|
"ctxt": 0
|
|
},
|
|
"test": null,
|
|
"consequent": [
|
|
{
|
|
"type": "ExpressionStatement",
|
|
"span": {
|
|
"start": 2404,
|
|
"end": 2432,
|
|
"ctxt": 0
|
|
},
|
|
"expression": {
|
|
"type": "AssignmentExpression",
|
|
"span": {
|
|
"start": 2404,
|
|
"end": 2431,
|
|
"ctxt": 0
|
|
},
|
|
"operator": "=",
|
|
"left": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 2404,
|
|
"end": 2405,
|
|
"ctxt": 0
|
|
},
|
|
"value": "s",
|
|
"optional": false,
|
|
"typeAnnotation": null
|
|
},
|
|
"right": {
|
|
"type": "StringLiteral",
|
|
"span": {
|
|
"start": 2408,
|
|
"end": 2431,
|
|
"ctxt": 0
|
|
},
|
|
"value": "it was something else",
|
|
"hasEscape": false,
|
|
"kind": {
|
|
"type": "normal",
|
|
"containsQuote": true
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"type": "BreakStatement",
|
|
"span": {
|
|
"start": 2433,
|
|
"end": 2439,
|
|
"ctxt": 0
|
|
},
|
|
"label": null
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "ReturnStatement",
|
|
"span": {
|
|
"start": 2444,
|
|
"end": 2453,
|
|
"ctxt": 0
|
|
},
|
|
"argument": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 2451,
|
|
"end": 2452,
|
|
"ctxt": 0
|
|
},
|
|
"value": "s",
|
|
"optional": false
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"generator": false,
|
|
"async": false,
|
|
"typeParameters": null,
|
|
"returnType": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 2272,
|
|
"end": 2280,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsKeywordType",
|
|
"span": {
|
|
"start": 2274,
|
|
"end": 2280,
|
|
"ctxt": 0
|
|
},
|
|
"kind": "string"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"type": "FunctionDeclaration",
|
|
"identifier": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 2466,
|
|
"end": 2471,
|
|
"ctxt": 0
|
|
},
|
|
"value": "good2",
|
|
"optional": false
|
|
},
|
|
"declare": false,
|
|
"params": [
|
|
{
|
|
"type": "Parameter",
|
|
"span": {
|
|
"start": 2472,
|
|
"end": 2481,
|
|
"ctxt": 0
|
|
},
|
|
"decorators": [],
|
|
"pat": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 2472,
|
|
"end": 2481,
|
|
"ctxt": 0
|
|
},
|
|
"value": "e",
|
|
"optional": false,
|
|
"typeAnnotation": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 2473,
|
|
"end": 2481,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsTypeReference",
|
|
"span": {
|
|
"start": 2475,
|
|
"end": 2481,
|
|
"ctxt": 0
|
|
},
|
|
"typeName": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 2475,
|
|
"end": 2481,
|
|
"ctxt": 0
|
|
},
|
|
"value": "MyEnum",
|
|
"optional": false
|
|
},
|
|
"typeParams": null
|
|
}
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"decorators": [],
|
|
"span": {
|
|
"start": 2457,
|
|
"end": 2583,
|
|
"ctxt": 0
|
|
},
|
|
"body": {
|
|
"type": "BlockStatement",
|
|
"span": {
|
|
"start": 2491,
|
|
"end": 2583,
|
|
"ctxt": 0
|
|
},
|
|
"stmts": [
|
|
{
|
|
"type": "SwitchStatement",
|
|
"span": {
|
|
"start": 2494,
|
|
"end": 2581,
|
|
"ctxt": 0
|
|
},
|
|
"discriminant": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 2502,
|
|
"end": 2503,
|
|
"ctxt": 0
|
|
},
|
|
"value": "e",
|
|
"optional": false
|
|
},
|
|
"cases": [
|
|
{
|
|
"type": "SwitchCase",
|
|
"span": {
|
|
"start": 2509,
|
|
"end": 2542,
|
|
"ctxt": 0
|
|
},
|
|
"test": {
|
|
"type": "MemberExpression",
|
|
"span": {
|
|
"start": 2514,
|
|
"end": 2522,
|
|
"ctxt": 0
|
|
},
|
|
"object": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 2514,
|
|
"end": 2520,
|
|
"ctxt": 0
|
|
},
|
|
"value": "MyEnum",
|
|
"optional": false
|
|
},
|
|
"property": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 2521,
|
|
"end": 2522,
|
|
"ctxt": 0
|
|
},
|
|
"value": "A",
|
|
"optional": false
|
|
}
|
|
},
|
|
"consequent": [
|
|
{
|
|
"type": "ReturnStatement",
|
|
"span": {
|
|
"start": 2524,
|
|
"end": 2542,
|
|
"ctxt": 0
|
|
},
|
|
"argument": {
|
|
"type": "StringLiteral",
|
|
"span": {
|
|
"start": 2531,
|
|
"end": 2541,
|
|
"ctxt": 0
|
|
},
|
|
"value": "it was A",
|
|
"hasEscape": false,
|
|
"kind": {
|
|
"type": "normal",
|
|
"containsQuote": true
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "SwitchCase",
|
|
"span": {
|
|
"start": 2545,
|
|
"end": 2578,
|
|
"ctxt": 0
|
|
},
|
|
"test": {
|
|
"type": "MemberExpression",
|
|
"span": {
|
|
"start": 2550,
|
|
"end": 2558,
|
|
"ctxt": 0
|
|
},
|
|
"object": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 2550,
|
|
"end": 2556,
|
|
"ctxt": 0
|
|
},
|
|
"value": "MyEnum",
|
|
"optional": false
|
|
},
|
|
"property": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 2557,
|
|
"end": 2558,
|
|
"ctxt": 0
|
|
},
|
|
"value": "B",
|
|
"optional": false
|
|
}
|
|
},
|
|
"consequent": [
|
|
{
|
|
"type": "ReturnStatement",
|
|
"span": {
|
|
"start": 2560,
|
|
"end": 2578,
|
|
"ctxt": 0
|
|
},
|
|
"argument": {
|
|
"type": "StringLiteral",
|
|
"span": {
|
|
"start": 2567,
|
|
"end": 2577,
|
|
"ctxt": 0
|
|
},
|
|
"value": "it was B",
|
|
"hasEscape": false,
|
|
"kind": {
|
|
"type": "normal",
|
|
"containsQuote": true
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"generator": false,
|
|
"async": false,
|
|
"typeParameters": null,
|
|
"returnType": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 2482,
|
|
"end": 2490,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsKeywordType",
|
|
"span": {
|
|
"start": 2484,
|
|
"end": 2490,
|
|
"ctxt": 0
|
|
},
|
|
"kind": "string"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"type": "TsEnumDeclaration",
|
|
"span": {
|
|
"start": 2607,
|
|
"end": 2635,
|
|
"ctxt": 0
|
|
},
|
|
"declare": false,
|
|
"isConst": false,
|
|
"id": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 2612,
|
|
"end": 2617,
|
|
"ctxt": 0
|
|
},
|
|
"value": "Level",
|
|
"optional": false
|
|
},
|
|
"members": [
|
|
{
|
|
"type": "TsEnumMember",
|
|
"span": {
|
|
"start": 2622,
|
|
"end": 2625,
|
|
"ctxt": 0
|
|
},
|
|
"id": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 2622,
|
|
"end": 2625,
|
|
"ctxt": 0
|
|
},
|
|
"value": "One",
|
|
"optional": false
|
|
},
|
|
"init": null
|
|
},
|
|
{
|
|
"type": "TsEnumMember",
|
|
"span": {
|
|
"start": 2629,
|
|
"end": 2632,
|
|
"ctxt": 0
|
|
},
|
|
"id": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 2629,
|
|
"end": 2632,
|
|
"ctxt": 0
|
|
},
|
|
"value": "Two",
|
|
"optional": false
|
|
},
|
|
"init": null
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "VariableDeclaration",
|
|
"span": {
|
|
"start": 2637,
|
|
"end": 2859,
|
|
"ctxt": 0
|
|
},
|
|
"kind": "const",
|
|
"declare": false,
|
|
"declarations": [
|
|
{
|
|
"type": "VariableDeclarator",
|
|
"span": {
|
|
"start": 2643,
|
|
"end": 2858,
|
|
"ctxt": 0
|
|
},
|
|
"id": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 2643,
|
|
"end": 2663,
|
|
"ctxt": 0
|
|
},
|
|
"value": "doSomethingWithLevel",
|
|
"optional": false,
|
|
"typeAnnotation": null
|
|
},
|
|
"init": {
|
|
"type": "ArrowFunctionExpression",
|
|
"span": {
|
|
"start": 2666,
|
|
"end": 2858,
|
|
"ctxt": 0
|
|
},
|
|
"params": [
|
|
{
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 2667,
|
|
"end": 2679,
|
|
"ctxt": 0
|
|
},
|
|
"value": "level",
|
|
"optional": false,
|
|
"typeAnnotation": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 2672,
|
|
"end": 2679,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsTypeReference",
|
|
"span": {
|
|
"start": 2674,
|
|
"end": 2679,
|
|
"ctxt": 0
|
|
},
|
|
"typeName": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 2674,
|
|
"end": 2679,
|
|
"ctxt": 0
|
|
},
|
|
"value": "Level",
|
|
"optional": false
|
|
},
|
|
"typeParams": null
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"body": {
|
|
"type": "BlockStatement",
|
|
"span": {
|
|
"start": 2684,
|
|
"end": 2858,
|
|
"ctxt": 0
|
|
},
|
|
"stmts": [
|
|
{
|
|
"type": "VariableDeclaration",
|
|
"span": {
|
|
"start": 2688,
|
|
"end": 2704,
|
|
"ctxt": 0
|
|
},
|
|
"kind": "let",
|
|
"declare": false,
|
|
"declarations": [
|
|
{
|
|
"type": "VariableDeclarator",
|
|
"span": {
|
|
"start": 2692,
|
|
"end": 2703,
|
|
"ctxt": 0
|
|
},
|
|
"id": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 2692,
|
|
"end": 2696,
|
|
"ctxt": 0
|
|
},
|
|
"value": "next",
|
|
"optional": false,
|
|
"typeAnnotation": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 2696,
|
|
"end": 2703,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsTypeReference",
|
|
"span": {
|
|
"start": 2698,
|
|
"end": 2703,
|
|
"ctxt": 0
|
|
},
|
|
"typeName": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 2698,
|
|
"end": 2703,
|
|
"ctxt": 0
|
|
},
|
|
"value": "Level",
|
|
"optional": false
|
|
},
|
|
"typeParams": null
|
|
}
|
|
}
|
|
},
|
|
"init": null,
|
|
"definite": false
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "SwitchStatement",
|
|
"span": {
|
|
"start": 2707,
|
|
"end": 2841,
|
|
"ctxt": 0
|
|
},
|
|
"discriminant": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 2715,
|
|
"end": 2720,
|
|
"ctxt": 0
|
|
},
|
|
"value": "level",
|
|
"optional": false
|
|
},
|
|
"cases": [
|
|
{
|
|
"type": "SwitchCase",
|
|
"span": {
|
|
"start": 2728,
|
|
"end": 2780,
|
|
"ctxt": 0
|
|
},
|
|
"test": {
|
|
"type": "MemberExpression",
|
|
"span": {
|
|
"start": 2733,
|
|
"end": 2742,
|
|
"ctxt": 0
|
|
},
|
|
"object": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 2733,
|
|
"end": 2738,
|
|
"ctxt": 0
|
|
},
|
|
"value": "Level",
|
|
"optional": false
|
|
},
|
|
"property": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 2739,
|
|
"end": 2742,
|
|
"ctxt": 0
|
|
},
|
|
"value": "One",
|
|
"optional": false
|
|
}
|
|
},
|
|
"consequent": [
|
|
{
|
|
"type": "ExpressionStatement",
|
|
"span": {
|
|
"start": 2750,
|
|
"end": 2767,
|
|
"ctxt": 0
|
|
},
|
|
"expression": {
|
|
"type": "AssignmentExpression",
|
|
"span": {
|
|
"start": 2750,
|
|
"end": 2766,
|
|
"ctxt": 0
|
|
},
|
|
"operator": "=",
|
|
"left": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 2750,
|
|
"end": 2754,
|
|
"ctxt": 0
|
|
},
|
|
"value": "next",
|
|
"optional": false,
|
|
"typeAnnotation": null
|
|
},
|
|
"right": {
|
|
"type": "MemberExpression",
|
|
"span": {
|
|
"start": 2757,
|
|
"end": 2766,
|
|
"ctxt": 0
|
|
},
|
|
"object": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 2757,
|
|
"end": 2762,
|
|
"ctxt": 0
|
|
},
|
|
"value": "Level",
|
|
"optional": false
|
|
},
|
|
"property": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 2763,
|
|
"end": 2766,
|
|
"ctxt": 0
|
|
},
|
|
"value": "Two",
|
|
"optional": false
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"type": "BreakStatement",
|
|
"span": {
|
|
"start": 2774,
|
|
"end": 2780,
|
|
"ctxt": 0
|
|
},
|
|
"label": null
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "SwitchCase",
|
|
"span": {
|
|
"start": 2785,
|
|
"end": 2837,
|
|
"ctxt": 0
|
|
},
|
|
"test": {
|
|
"type": "MemberExpression",
|
|
"span": {
|
|
"start": 2790,
|
|
"end": 2799,
|
|
"ctxt": 0
|
|
},
|
|
"object": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 2790,
|
|
"end": 2795,
|
|
"ctxt": 0
|
|
},
|
|
"value": "Level",
|
|
"optional": false
|
|
},
|
|
"property": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 2796,
|
|
"end": 2799,
|
|
"ctxt": 0
|
|
},
|
|
"value": "Two",
|
|
"optional": false
|
|
}
|
|
},
|
|
"consequent": [
|
|
{
|
|
"type": "ExpressionStatement",
|
|
"span": {
|
|
"start": 2807,
|
|
"end": 2824,
|
|
"ctxt": 0
|
|
},
|
|
"expression": {
|
|
"type": "AssignmentExpression",
|
|
"span": {
|
|
"start": 2807,
|
|
"end": 2823,
|
|
"ctxt": 0
|
|
},
|
|
"operator": "=",
|
|
"left": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 2807,
|
|
"end": 2811,
|
|
"ctxt": 0
|
|
},
|
|
"value": "next",
|
|
"optional": false,
|
|
"typeAnnotation": null
|
|
},
|
|
"right": {
|
|
"type": "MemberExpression",
|
|
"span": {
|
|
"start": 2814,
|
|
"end": 2823,
|
|
"ctxt": 0
|
|
},
|
|
"object": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 2814,
|
|
"end": 2819,
|
|
"ctxt": 0
|
|
},
|
|
"value": "Level",
|
|
"optional": false
|
|
},
|
|
"property": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 2820,
|
|
"end": 2823,
|
|
"ctxt": 0
|
|
},
|
|
"value": "One",
|
|
"optional": false
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"type": "BreakStatement",
|
|
"span": {
|
|
"start": 2831,
|
|
"end": 2837,
|
|
"ctxt": 0
|
|
},
|
|
"label": null
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "ReturnStatement",
|
|
"span": {
|
|
"start": 2844,
|
|
"end": 2856,
|
|
"ctxt": 0
|
|
},
|
|
"argument": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 2851,
|
|
"end": 2855,
|
|
"ctxt": 0
|
|
},
|
|
"value": "next",
|
|
"optional": false
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"async": false,
|
|
"generator": false,
|
|
"typeParameters": null,
|
|
"returnType": null
|
|
},
|
|
"definite": false
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "TsInterfaceDeclaration",
|
|
"span": {
|
|
"start": 2883,
|
|
"end": 2942,
|
|
"ctxt": 0
|
|
},
|
|
"id": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 2893,
|
|
"end": 2900,
|
|
"ctxt": 0
|
|
},
|
|
"value": "Square2",
|
|
"optional": false
|
|
},
|
|
"declare": false,
|
|
"typeParams": null,
|
|
"extends": [],
|
|
"body": {
|
|
"type": "TsInterfaceBody",
|
|
"span": {
|
|
"start": 2901,
|
|
"end": 2942,
|
|
"ctxt": 0
|
|
},
|
|
"body": [
|
|
{
|
|
"type": "TsPropertySignature",
|
|
"span": {
|
|
"start": 2907,
|
|
"end": 2922,
|
|
"ctxt": 0
|
|
},
|
|
"readonly": false,
|
|
"key": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 2907,
|
|
"end": 2911,
|
|
"ctxt": 0
|
|
},
|
|
"value": "kind",
|
|
"optional": false
|
|
},
|
|
"computed": false,
|
|
"optional": false,
|
|
"init": null,
|
|
"params": [],
|
|
"typeAnnotation": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 2911,
|
|
"end": 2921,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsLiteralType",
|
|
"span": {
|
|
"start": 2913,
|
|
"end": 2921,
|
|
"ctxt": 0
|
|
},
|
|
"literal": {
|
|
"type": "StringLiteral",
|
|
"span": {
|
|
"start": 2913,
|
|
"end": 2921,
|
|
"ctxt": 0
|
|
},
|
|
"value": "square",
|
|
"hasEscape": false,
|
|
"kind": {
|
|
"type": "normal",
|
|
"containsQuote": true
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"typeParams": null
|
|
},
|
|
{
|
|
"type": "TsPropertySignature",
|
|
"span": {
|
|
"start": 2927,
|
|
"end": 2940,
|
|
"ctxt": 0
|
|
},
|
|
"readonly": false,
|
|
"key": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 2927,
|
|
"end": 2931,
|
|
"ctxt": 0
|
|
},
|
|
"value": "size",
|
|
"optional": false
|
|
},
|
|
"computed": false,
|
|
"optional": false,
|
|
"init": null,
|
|
"params": [],
|
|
"typeAnnotation": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 2931,
|
|
"end": 2939,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsKeywordType",
|
|
"span": {
|
|
"start": 2933,
|
|
"end": 2939,
|
|
"ctxt": 0
|
|
},
|
|
"kind": "number"
|
|
}
|
|
},
|
|
"typeParams": null
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "TsInterfaceDeclaration",
|
|
"span": {
|
|
"start": 2944,
|
|
"end": 3005,
|
|
"ctxt": 0
|
|
},
|
|
"id": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 2954,
|
|
"end": 2961,
|
|
"ctxt": 0
|
|
},
|
|
"value": "Circle2",
|
|
"optional": false
|
|
},
|
|
"declare": false,
|
|
"typeParams": null,
|
|
"extends": [],
|
|
"body": {
|
|
"type": "TsInterfaceBody",
|
|
"span": {
|
|
"start": 2962,
|
|
"end": 3005,
|
|
"ctxt": 0
|
|
},
|
|
"body": [
|
|
{
|
|
"type": "TsPropertySignature",
|
|
"span": {
|
|
"start": 2968,
|
|
"end": 2983,
|
|
"ctxt": 0
|
|
},
|
|
"readonly": false,
|
|
"key": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 2968,
|
|
"end": 2972,
|
|
"ctxt": 0
|
|
},
|
|
"value": "kind",
|
|
"optional": false
|
|
},
|
|
"computed": false,
|
|
"optional": false,
|
|
"init": null,
|
|
"params": [],
|
|
"typeAnnotation": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 2972,
|
|
"end": 2982,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsLiteralType",
|
|
"span": {
|
|
"start": 2974,
|
|
"end": 2982,
|
|
"ctxt": 0
|
|
},
|
|
"literal": {
|
|
"type": "StringLiteral",
|
|
"span": {
|
|
"start": 2974,
|
|
"end": 2982,
|
|
"ctxt": 0
|
|
},
|
|
"value": "circle",
|
|
"hasEscape": false,
|
|
"kind": {
|
|
"type": "normal",
|
|
"containsQuote": true
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"typeParams": null
|
|
},
|
|
{
|
|
"type": "TsPropertySignature",
|
|
"span": {
|
|
"start": 2988,
|
|
"end": 3003,
|
|
"ctxt": 0
|
|
},
|
|
"readonly": false,
|
|
"key": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 2988,
|
|
"end": 2994,
|
|
"ctxt": 0
|
|
},
|
|
"value": "radius",
|
|
"optional": false
|
|
},
|
|
"computed": false,
|
|
"optional": false,
|
|
"init": null,
|
|
"params": [],
|
|
"typeAnnotation": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 2994,
|
|
"end": 3002,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsKeywordType",
|
|
"span": {
|
|
"start": 2996,
|
|
"end": 3002,
|
|
"ctxt": 0
|
|
},
|
|
"kind": "number"
|
|
}
|
|
},
|
|
"typeParams": null
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "TsTypeAliasDeclaration",
|
|
"span": {
|
|
"start": 3007,
|
|
"end": 3039,
|
|
"ctxt": 0
|
|
},
|
|
"declare": false,
|
|
"id": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 3012,
|
|
"end": 3018,
|
|
"ctxt": 0
|
|
},
|
|
"value": "Shape2",
|
|
"optional": false
|
|
},
|
|
"typeParams": null,
|
|
"typeAnnotation": {
|
|
"type": "TsUnionType",
|
|
"span": {
|
|
"start": 3021,
|
|
"end": 3038,
|
|
"ctxt": 0
|
|
},
|
|
"types": [
|
|
{
|
|
"type": "TsTypeReference",
|
|
"span": {
|
|
"start": 3021,
|
|
"end": 3028,
|
|
"ctxt": 0
|
|
},
|
|
"typeName": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 3021,
|
|
"end": 3028,
|
|
"ctxt": 0
|
|
},
|
|
"value": "Square2",
|
|
"optional": false
|
|
},
|
|
"typeParams": null
|
|
},
|
|
{
|
|
"type": "TsTypeReference",
|
|
"span": {
|
|
"start": 3031,
|
|
"end": 3038,
|
|
"ctxt": 0
|
|
},
|
|
"typeName": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 3031,
|
|
"end": 3038,
|
|
"ctxt": 0
|
|
},
|
|
"value": "Circle2",
|
|
"optional": false
|
|
},
|
|
"typeParams": null
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "FunctionDeclaration",
|
|
"identifier": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 3050,
|
|
"end": 3061,
|
|
"ctxt": 0
|
|
},
|
|
"value": "withDefault",
|
|
"optional": false
|
|
},
|
|
"declare": false,
|
|
"params": [
|
|
{
|
|
"type": "Parameter",
|
|
"span": {
|
|
"start": 3062,
|
|
"end": 3072,
|
|
"ctxt": 0
|
|
},
|
|
"decorators": [],
|
|
"pat": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 3062,
|
|
"end": 3072,
|
|
"ctxt": 0
|
|
},
|
|
"value": "s1",
|
|
"optional": false,
|
|
"typeAnnotation": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 3064,
|
|
"end": 3072,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsTypeReference",
|
|
"span": {
|
|
"start": 3066,
|
|
"end": 3072,
|
|
"ctxt": 0
|
|
},
|
|
"typeName": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 3066,
|
|
"end": 3072,
|
|
"ctxt": 0
|
|
},
|
|
"value": "Shape2",
|
|
"optional": false
|
|
},
|
|
"typeParams": null
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"type": "Parameter",
|
|
"span": {
|
|
"start": 3074,
|
|
"end": 3084,
|
|
"ctxt": 0
|
|
},
|
|
"decorators": [],
|
|
"pat": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 3074,
|
|
"end": 3084,
|
|
"ctxt": 0
|
|
},
|
|
"value": "s2",
|
|
"optional": false,
|
|
"typeAnnotation": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 3076,
|
|
"end": 3084,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsTypeReference",
|
|
"span": {
|
|
"start": 3078,
|
|
"end": 3084,
|
|
"ctxt": 0
|
|
},
|
|
"typeName": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 3078,
|
|
"end": 3084,
|
|
"ctxt": 0
|
|
},
|
|
"value": "Shape2",
|
|
"optional": false
|
|
},
|
|
"typeParams": null
|
|
}
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"decorators": [],
|
|
"span": {
|
|
"start": 3041,
|
|
"end": 3428,
|
|
"ctxt": 0
|
|
},
|
|
"body": {
|
|
"type": "BlockStatement",
|
|
"span": {
|
|
"start": 3094,
|
|
"end": 3428,
|
|
"ctxt": 0
|
|
},
|
|
"stmts": [
|
|
{
|
|
"type": "SwitchStatement",
|
|
"span": {
|
|
"start": 3100,
|
|
"end": 3426,
|
|
"ctxt": 0
|
|
},
|
|
"discriminant": {
|
|
"type": "MemberExpression",
|
|
"span": {
|
|
"start": 3108,
|
|
"end": 3115,
|
|
"ctxt": 0
|
|
},
|
|
"object": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 3108,
|
|
"end": 3110,
|
|
"ctxt": 0
|
|
},
|
|
"value": "s1",
|
|
"optional": false
|
|
},
|
|
"property": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 3111,
|
|
"end": 3115,
|
|
"ctxt": 0
|
|
},
|
|
"value": "kind",
|
|
"optional": false
|
|
}
|
|
},
|
|
"cases": [
|
|
{
|
|
"type": "SwitchCase",
|
|
"span": {
|
|
"start": 3127,
|
|
"end": 3165,
|
|
"ctxt": 0
|
|
},
|
|
"test": {
|
|
"type": "StringLiteral",
|
|
"span": {
|
|
"start": 3132,
|
|
"end": 3140,
|
|
"ctxt": 0
|
|
},
|
|
"value": "square",
|
|
"hasEscape": false,
|
|
"kind": {
|
|
"type": "normal",
|
|
"containsQuote": true
|
|
}
|
|
},
|
|
"consequent": [
|
|
{
|
|
"type": "ReturnStatement",
|
|
"span": {
|
|
"start": 3154,
|
|
"end": 3165,
|
|
"ctxt": 0
|
|
},
|
|
"argument": {
|
|
"type": "StringLiteral",
|
|
"span": {
|
|
"start": 3161,
|
|
"end": 3164,
|
|
"ctxt": 0
|
|
},
|
|
"value": "1",
|
|
"hasEscape": false,
|
|
"kind": {
|
|
"type": "normal",
|
|
"containsQuote": true
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "SwitchCase",
|
|
"span": {
|
|
"start": 3174,
|
|
"end": 3420,
|
|
"ctxt": 0
|
|
},
|
|
"test": {
|
|
"type": "StringLiteral",
|
|
"span": {
|
|
"start": 3179,
|
|
"end": 3187,
|
|
"ctxt": 0
|
|
},
|
|
"value": "circle",
|
|
"hasEscape": false,
|
|
"kind": {
|
|
"type": "normal",
|
|
"containsQuote": true
|
|
}
|
|
},
|
|
"consequent": [
|
|
{
|
|
"type": "SwitchStatement",
|
|
"span": {
|
|
"start": 3201,
|
|
"end": 3420,
|
|
"ctxt": 0
|
|
},
|
|
"discriminant": {
|
|
"type": "MemberExpression",
|
|
"span": {
|
|
"start": 3209,
|
|
"end": 3216,
|
|
"ctxt": 0
|
|
},
|
|
"object": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 3209,
|
|
"end": 3211,
|
|
"ctxt": 0
|
|
},
|
|
"value": "s2",
|
|
"optional": false
|
|
},
|
|
"property": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 3212,
|
|
"end": 3216,
|
|
"ctxt": 0
|
|
},
|
|
"value": "kind",
|
|
"optional": false
|
|
}
|
|
},
|
|
"cases": [
|
|
{
|
|
"type": "SwitchCase",
|
|
"span": {
|
|
"start": 3236,
|
|
"end": 3282,
|
|
"ctxt": 0
|
|
},
|
|
"test": {
|
|
"type": "StringLiteral",
|
|
"span": {
|
|
"start": 3241,
|
|
"end": 3249,
|
|
"ctxt": 0
|
|
},
|
|
"value": "square",
|
|
"hasEscape": false,
|
|
"kind": {
|
|
"type": "normal",
|
|
"containsQuote": true
|
|
}
|
|
},
|
|
"consequent": [
|
|
{
|
|
"type": "ReturnStatement",
|
|
"span": {
|
|
"start": 3271,
|
|
"end": 3282,
|
|
"ctxt": 0
|
|
},
|
|
"argument": {
|
|
"type": "StringLiteral",
|
|
"span": {
|
|
"start": 3278,
|
|
"end": 3281,
|
|
"ctxt": 0
|
|
},
|
|
"value": "2",
|
|
"hasEscape": false,
|
|
"kind": {
|
|
"type": "normal",
|
|
"containsQuote": true
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "SwitchCase",
|
|
"span": {
|
|
"start": 3299,
|
|
"end": 3345,
|
|
"ctxt": 0
|
|
},
|
|
"test": {
|
|
"type": "StringLiteral",
|
|
"span": {
|
|
"start": 3304,
|
|
"end": 3312,
|
|
"ctxt": 0
|
|
},
|
|
"value": "circle",
|
|
"hasEscape": false,
|
|
"kind": {
|
|
"type": "normal",
|
|
"containsQuote": true
|
|
}
|
|
},
|
|
"consequent": [
|
|
{
|
|
"type": "ReturnStatement",
|
|
"span": {
|
|
"start": 3334,
|
|
"end": 3345,
|
|
"ctxt": 0
|
|
},
|
|
"argument": {
|
|
"type": "StringLiteral",
|
|
"span": {
|
|
"start": 3341,
|
|
"end": 3344,
|
|
"ctxt": 0
|
|
},
|
|
"value": "3",
|
|
"hasEscape": false,
|
|
"kind": {
|
|
"type": "normal",
|
|
"containsQuote": true
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "SwitchCase",
|
|
"span": {
|
|
"start": 3362,
|
|
"end": 3406,
|
|
"ctxt": 0
|
|
},
|
|
"test": null,
|
|
"consequent": [
|
|
{
|
|
"type": "ReturnStatement",
|
|
"span": {
|
|
"start": 3391,
|
|
"end": 3406,
|
|
"ctxt": 0
|
|
},
|
|
"argument": {
|
|
"type": "StringLiteral",
|
|
"span": {
|
|
"start": 3398,
|
|
"end": 3405,
|
|
"ctxt": 0
|
|
},
|
|
"value": "never",
|
|
"hasEscape": false,
|
|
"kind": {
|
|
"type": "normal",
|
|
"containsQuote": true
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"generator": false,
|
|
"async": false,
|
|
"typeParameters": null,
|
|
"returnType": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 3085,
|
|
"end": 3093,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsKeywordType",
|
|
"span": {
|
|
"start": 3087,
|
|
"end": 3093,
|
|
"ctxt": 0
|
|
},
|
|
"kind": "string"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"type": "FunctionDeclaration",
|
|
"identifier": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 3439,
|
|
"end": 3453,
|
|
"ctxt": 0
|
|
},
|
|
"value": "withoutDefault",
|
|
"optional": false
|
|
},
|
|
"declare": false,
|
|
"params": [
|
|
{
|
|
"type": "Parameter",
|
|
"span": {
|
|
"start": 3454,
|
|
"end": 3464,
|
|
"ctxt": 0
|
|
},
|
|
"decorators": [],
|
|
"pat": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 3454,
|
|
"end": 3464,
|
|
"ctxt": 0
|
|
},
|
|
"value": "s1",
|
|
"optional": false,
|
|
"typeAnnotation": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 3456,
|
|
"end": 3464,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsTypeReference",
|
|
"span": {
|
|
"start": 3458,
|
|
"end": 3464,
|
|
"ctxt": 0
|
|
},
|
|
"typeName": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 3458,
|
|
"end": 3464,
|
|
"ctxt": 0
|
|
},
|
|
"value": "Shape2",
|
|
"optional": false
|
|
},
|
|
"typeParams": null
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"type": "Parameter",
|
|
"span": {
|
|
"start": 3466,
|
|
"end": 3476,
|
|
"ctxt": 0
|
|
},
|
|
"decorators": [],
|
|
"pat": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 3466,
|
|
"end": 3476,
|
|
"ctxt": 0
|
|
},
|
|
"value": "s2",
|
|
"optional": false,
|
|
"typeAnnotation": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 3468,
|
|
"end": 3476,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsTypeReference",
|
|
"span": {
|
|
"start": 3470,
|
|
"end": 3476,
|
|
"ctxt": 0
|
|
},
|
|
"typeName": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 3470,
|
|
"end": 3476,
|
|
"ctxt": 0
|
|
},
|
|
"value": "Shape2",
|
|
"optional": false
|
|
},
|
|
"typeParams": null
|
|
}
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"decorators": [],
|
|
"span": {
|
|
"start": 3430,
|
|
"end": 3759,
|
|
"ctxt": 0
|
|
},
|
|
"body": {
|
|
"type": "BlockStatement",
|
|
"span": {
|
|
"start": 3486,
|
|
"end": 3759,
|
|
"ctxt": 0
|
|
},
|
|
"stmts": [
|
|
{
|
|
"type": "SwitchStatement",
|
|
"span": {
|
|
"start": 3492,
|
|
"end": 3757,
|
|
"ctxt": 0
|
|
},
|
|
"discriminant": {
|
|
"type": "MemberExpression",
|
|
"span": {
|
|
"start": 3500,
|
|
"end": 3507,
|
|
"ctxt": 0
|
|
},
|
|
"object": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 3500,
|
|
"end": 3502,
|
|
"ctxt": 0
|
|
},
|
|
"value": "s1",
|
|
"optional": false
|
|
},
|
|
"property": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 3503,
|
|
"end": 3507,
|
|
"ctxt": 0
|
|
},
|
|
"value": "kind",
|
|
"optional": false
|
|
}
|
|
},
|
|
"cases": [
|
|
{
|
|
"type": "SwitchCase",
|
|
"span": {
|
|
"start": 3519,
|
|
"end": 3557,
|
|
"ctxt": 0
|
|
},
|
|
"test": {
|
|
"type": "StringLiteral",
|
|
"span": {
|
|
"start": 3524,
|
|
"end": 3532,
|
|
"ctxt": 0
|
|
},
|
|
"value": "square",
|
|
"hasEscape": false,
|
|
"kind": {
|
|
"type": "normal",
|
|
"containsQuote": true
|
|
}
|
|
},
|
|
"consequent": [
|
|
{
|
|
"type": "ReturnStatement",
|
|
"span": {
|
|
"start": 3546,
|
|
"end": 3557,
|
|
"ctxt": 0
|
|
},
|
|
"argument": {
|
|
"type": "StringLiteral",
|
|
"span": {
|
|
"start": 3553,
|
|
"end": 3556,
|
|
"ctxt": 0
|
|
},
|
|
"value": "1",
|
|
"hasEscape": false,
|
|
"kind": {
|
|
"type": "normal",
|
|
"containsQuote": true
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "SwitchCase",
|
|
"span": {
|
|
"start": 3566,
|
|
"end": 3751,
|
|
"ctxt": 0
|
|
},
|
|
"test": {
|
|
"type": "StringLiteral",
|
|
"span": {
|
|
"start": 3571,
|
|
"end": 3579,
|
|
"ctxt": 0
|
|
},
|
|
"value": "circle",
|
|
"hasEscape": false,
|
|
"kind": {
|
|
"type": "normal",
|
|
"containsQuote": true
|
|
}
|
|
},
|
|
"consequent": [
|
|
{
|
|
"type": "SwitchStatement",
|
|
"span": {
|
|
"start": 3593,
|
|
"end": 3751,
|
|
"ctxt": 0
|
|
},
|
|
"discriminant": {
|
|
"type": "MemberExpression",
|
|
"span": {
|
|
"start": 3601,
|
|
"end": 3608,
|
|
"ctxt": 0
|
|
},
|
|
"object": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 3601,
|
|
"end": 3603,
|
|
"ctxt": 0
|
|
},
|
|
"value": "s2",
|
|
"optional": false
|
|
},
|
|
"property": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 3604,
|
|
"end": 3608,
|
|
"ctxt": 0
|
|
},
|
|
"value": "kind",
|
|
"optional": false
|
|
}
|
|
},
|
|
"cases": [
|
|
{
|
|
"type": "SwitchCase",
|
|
"span": {
|
|
"start": 3628,
|
|
"end": 3674,
|
|
"ctxt": 0
|
|
},
|
|
"test": {
|
|
"type": "StringLiteral",
|
|
"span": {
|
|
"start": 3633,
|
|
"end": 3641,
|
|
"ctxt": 0
|
|
},
|
|
"value": "square",
|
|
"hasEscape": false,
|
|
"kind": {
|
|
"type": "normal",
|
|
"containsQuote": true
|
|
}
|
|
},
|
|
"consequent": [
|
|
{
|
|
"type": "ReturnStatement",
|
|
"span": {
|
|
"start": 3663,
|
|
"end": 3674,
|
|
"ctxt": 0
|
|
},
|
|
"argument": {
|
|
"type": "StringLiteral",
|
|
"span": {
|
|
"start": 3670,
|
|
"end": 3673,
|
|
"ctxt": 0
|
|
},
|
|
"value": "2",
|
|
"hasEscape": false,
|
|
"kind": {
|
|
"type": "normal",
|
|
"containsQuote": true
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "SwitchCase",
|
|
"span": {
|
|
"start": 3691,
|
|
"end": 3737,
|
|
"ctxt": 0
|
|
},
|
|
"test": {
|
|
"type": "StringLiteral",
|
|
"span": {
|
|
"start": 3696,
|
|
"end": 3704,
|
|
"ctxt": 0
|
|
},
|
|
"value": "circle",
|
|
"hasEscape": false,
|
|
"kind": {
|
|
"type": "normal",
|
|
"containsQuote": true
|
|
}
|
|
},
|
|
"consequent": [
|
|
{
|
|
"type": "ReturnStatement",
|
|
"span": {
|
|
"start": 3726,
|
|
"end": 3737,
|
|
"ctxt": 0
|
|
},
|
|
"argument": {
|
|
"type": "StringLiteral",
|
|
"span": {
|
|
"start": 3733,
|
|
"end": 3736,
|
|
"ctxt": 0
|
|
},
|
|
"value": "3",
|
|
"hasEscape": false,
|
|
"kind": {
|
|
"type": "normal",
|
|
"containsQuote": true
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"generator": false,
|
|
"async": false,
|
|
"typeParameters": null,
|
|
"returnType": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 3477,
|
|
"end": 3485,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsKeywordType",
|
|
"span": {
|
|
"start": 3479,
|
|
"end": 3485,
|
|
"ctxt": 0
|
|
},
|
|
"kind": "string"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"type": "FunctionDeclaration",
|
|
"identifier": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 3792,
|
|
"end": 3797,
|
|
"ctxt": 0
|
|
},
|
|
"value": "test4",
|
|
"optional": false
|
|
},
|
|
"declare": false,
|
|
"params": [
|
|
{
|
|
"type": "Parameter",
|
|
"span": {
|
|
"start": 3798,
|
|
"end": 3810,
|
|
"ctxt": 0
|
|
},
|
|
"decorators": [],
|
|
"pat": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 3798,
|
|
"end": 3810,
|
|
"ctxt": 0
|
|
},
|
|
"value": "value",
|
|
"optional": false,
|
|
"typeAnnotation": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 3803,
|
|
"end": 3810,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsUnionType",
|
|
"span": {
|
|
"start": 3805,
|
|
"end": 3810,
|
|
"ctxt": 0
|
|
},
|
|
"types": [
|
|
{
|
|
"type": "TsLiteralType",
|
|
"span": {
|
|
"start": 3805,
|
|
"end": 3806,
|
|
"ctxt": 0
|
|
},
|
|
"literal": {
|
|
"type": "NumericLiteral",
|
|
"span": {
|
|
"start": 3805,
|
|
"end": 3806,
|
|
"ctxt": 0
|
|
},
|
|
"value": 1.0
|
|
}
|
|
},
|
|
{
|
|
"type": "TsLiteralType",
|
|
"span": {
|
|
"start": 3809,
|
|
"end": 3810,
|
|
"ctxt": 0
|
|
},
|
|
"literal": {
|
|
"type": "NumericLiteral",
|
|
"span": {
|
|
"start": 3809,
|
|
"end": 3810,
|
|
"ctxt": 0
|
|
},
|
|
"value": 2.0
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"decorators": [],
|
|
"span": {
|
|
"start": 3783,
|
|
"end": 3943,
|
|
"ctxt": 0
|
|
},
|
|
"body": {
|
|
"type": "BlockStatement",
|
|
"span": {
|
|
"start": 3812,
|
|
"end": 3943,
|
|
"ctxt": 0
|
|
},
|
|
"stmts": [
|
|
{
|
|
"type": "VariableDeclaration",
|
|
"span": {
|
|
"start": 3818,
|
|
"end": 3832,
|
|
"ctxt": 0
|
|
},
|
|
"kind": "let",
|
|
"declare": false,
|
|
"declarations": [
|
|
{
|
|
"type": "VariableDeclarator",
|
|
"span": {
|
|
"start": 3822,
|
|
"end": 3831,
|
|
"ctxt": 0
|
|
},
|
|
"id": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 3822,
|
|
"end": 3823,
|
|
"ctxt": 0
|
|
},
|
|
"value": "x",
|
|
"optional": false,
|
|
"typeAnnotation": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 3823,
|
|
"end": 3831,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsKeywordType",
|
|
"span": {
|
|
"start": 3825,
|
|
"end": 3831,
|
|
"ctxt": 0
|
|
},
|
|
"kind": "string"
|
|
}
|
|
}
|
|
},
|
|
"init": null,
|
|
"definite": false
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "SwitchStatement",
|
|
"span": {
|
|
"start": 3837,
|
|
"end": 3927,
|
|
"ctxt": 0
|
|
},
|
|
"discriminant": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 3845,
|
|
"end": 3850,
|
|
"ctxt": 0
|
|
},
|
|
"value": "value",
|
|
"optional": false
|
|
},
|
|
"cases": [
|
|
{
|
|
"type": "SwitchCase",
|
|
"span": {
|
|
"start": 3862,
|
|
"end": 3887,
|
|
"ctxt": 0
|
|
},
|
|
"test": {
|
|
"type": "NumericLiteral",
|
|
"span": {
|
|
"start": 3867,
|
|
"end": 3868,
|
|
"ctxt": 0
|
|
},
|
|
"value": 1.0
|
|
},
|
|
"consequent": [
|
|
{
|
|
"type": "ExpressionStatement",
|
|
"span": {
|
|
"start": 3870,
|
|
"end": 3880,
|
|
"ctxt": 0
|
|
},
|
|
"expression": {
|
|
"type": "AssignmentExpression",
|
|
"span": {
|
|
"start": 3870,
|
|
"end": 3879,
|
|
"ctxt": 0
|
|
},
|
|
"operator": "=",
|
|
"left": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 3870,
|
|
"end": 3871,
|
|
"ctxt": 0
|
|
},
|
|
"value": "x",
|
|
"optional": false,
|
|
"typeAnnotation": null
|
|
},
|
|
"right": {
|
|
"type": "StringLiteral",
|
|
"span": {
|
|
"start": 3874,
|
|
"end": 3879,
|
|
"ctxt": 0
|
|
},
|
|
"value": "one",
|
|
"hasEscape": false,
|
|
"kind": {
|
|
"type": "normal",
|
|
"containsQuote": true
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"type": "BreakStatement",
|
|
"span": {
|
|
"start": 3881,
|
|
"end": 3887,
|
|
"ctxt": 0
|
|
},
|
|
"label": null
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "SwitchCase",
|
|
"span": {
|
|
"start": 3896,
|
|
"end": 3921,
|
|
"ctxt": 0
|
|
},
|
|
"test": {
|
|
"type": "NumericLiteral",
|
|
"span": {
|
|
"start": 3901,
|
|
"end": 3902,
|
|
"ctxt": 0
|
|
},
|
|
"value": 2.0
|
|
},
|
|
"consequent": [
|
|
{
|
|
"type": "ExpressionStatement",
|
|
"span": {
|
|
"start": 3904,
|
|
"end": 3914,
|
|
"ctxt": 0
|
|
},
|
|
"expression": {
|
|
"type": "AssignmentExpression",
|
|
"span": {
|
|
"start": 3904,
|
|
"end": 3913,
|
|
"ctxt": 0
|
|
},
|
|
"operator": "=",
|
|
"left": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 3904,
|
|
"end": 3905,
|
|
"ctxt": 0
|
|
},
|
|
"value": "x",
|
|
"optional": false,
|
|
"typeAnnotation": null
|
|
},
|
|
"right": {
|
|
"type": "StringLiteral",
|
|
"span": {
|
|
"start": 3908,
|
|
"end": 3913,
|
|
"ctxt": 0
|
|
},
|
|
"value": "two",
|
|
"hasEscape": false,
|
|
"kind": {
|
|
"type": "normal",
|
|
"containsQuote": true
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"type": "BreakStatement",
|
|
"span": {
|
|
"start": 3915,
|
|
"end": 3921,
|
|
"ctxt": 0
|
|
},
|
|
"label": null
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "ReturnStatement",
|
|
"span": {
|
|
"start": 3932,
|
|
"end": 3941,
|
|
"ctxt": 0
|
|
},
|
|
"argument": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 3939,
|
|
"end": 3940,
|
|
"ctxt": 0
|
|
},
|
|
"value": "x",
|
|
"optional": false
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"generator": false,
|
|
"async": false,
|
|
"typeParameters": null,
|
|
"returnType": null
|
|
},
|
|
{
|
|
"type": "TsEnumDeclaration",
|
|
"span": {
|
|
"start": 3967,
|
|
"end": 3991,
|
|
"ctxt": 0
|
|
},
|
|
"declare": false,
|
|
"isConst": false,
|
|
"id": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 3972,
|
|
"end": 3978,
|
|
"ctxt": 0
|
|
},
|
|
"value": "Animal",
|
|
"optional": false
|
|
},
|
|
"members": [
|
|
{
|
|
"type": "TsEnumMember",
|
|
"span": {
|
|
"start": 3981,
|
|
"end": 3984,
|
|
"ctxt": 0
|
|
},
|
|
"id": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 3981,
|
|
"end": 3984,
|
|
"ctxt": 0
|
|
},
|
|
"value": "DOG",
|
|
"optional": false
|
|
},
|
|
"init": null
|
|
},
|
|
{
|
|
"type": "TsEnumMember",
|
|
"span": {
|
|
"start": 3986,
|
|
"end": 3989,
|
|
"ctxt": 0
|
|
},
|
|
"id": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 3986,
|
|
"end": 3989,
|
|
"ctxt": 0
|
|
},
|
|
"value": "CAT",
|
|
"optional": false
|
|
},
|
|
"init": null
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "VariableDeclaration",
|
|
"span": {
|
|
"start": 3993,
|
|
"end": 4043,
|
|
"ctxt": 0
|
|
},
|
|
"kind": "const",
|
|
"declare": true,
|
|
"declarations": [
|
|
{
|
|
"type": "VariableDeclarator",
|
|
"span": {
|
|
"start": 4007,
|
|
"end": 4042,
|
|
"ctxt": 0
|
|
},
|
|
"id": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 4007,
|
|
"end": 4010,
|
|
"ctxt": 0
|
|
},
|
|
"value": "zoo",
|
|
"optional": false,
|
|
"typeAnnotation": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 4010,
|
|
"end": 4042,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsUnionType",
|
|
"span": {
|
|
"start": 4012,
|
|
"end": 4042,
|
|
"ctxt": 0
|
|
},
|
|
"types": [
|
|
{
|
|
"type": "TsTypeLiteral",
|
|
"span": {
|
|
"start": 4012,
|
|
"end": 4030,
|
|
"ctxt": 0
|
|
},
|
|
"members": [
|
|
{
|
|
"type": "TsPropertySignature",
|
|
"span": {
|
|
"start": 4014,
|
|
"end": 4028,
|
|
"ctxt": 0
|
|
},
|
|
"readonly": false,
|
|
"key": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 4014,
|
|
"end": 4020,
|
|
"ctxt": 0
|
|
},
|
|
"value": "animal",
|
|
"optional": false
|
|
},
|
|
"computed": false,
|
|
"optional": false,
|
|
"init": null,
|
|
"params": [],
|
|
"typeAnnotation": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 4020,
|
|
"end": 4028,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsTypeReference",
|
|
"span": {
|
|
"start": 4022,
|
|
"end": 4028,
|
|
"ctxt": 0
|
|
},
|
|
"typeName": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 4022,
|
|
"end": 4028,
|
|
"ctxt": 0
|
|
},
|
|
"value": "Animal",
|
|
"optional": false
|
|
},
|
|
"typeParams": null
|
|
}
|
|
},
|
|
"typeParams": null
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "TsKeywordType",
|
|
"span": {
|
|
"start": 4033,
|
|
"end": 4042,
|
|
"ctxt": 0
|
|
},
|
|
"kind": "undefined"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"init": null,
|
|
"definite": false
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "FunctionDeclaration",
|
|
"identifier": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 4054,
|
|
"end": 4064,
|
|
"ctxt": 0
|
|
},
|
|
"value": "expression",
|
|
"optional": false
|
|
},
|
|
"declare": false,
|
|
"params": [],
|
|
"decorators": [],
|
|
"span": {
|
|
"start": 4045,
|
|
"end": 4211,
|
|
"ctxt": 0
|
|
},
|
|
"body": {
|
|
"type": "BlockStatement",
|
|
"span": {
|
|
"start": 4075,
|
|
"end": 4211,
|
|
"ctxt": 0
|
|
},
|
|
"stmts": [
|
|
{
|
|
"type": "SwitchStatement",
|
|
"span": {
|
|
"start": 4081,
|
|
"end": 4209,
|
|
"ctxt": 0
|
|
},
|
|
"discriminant": {
|
|
"type": "BinaryExpression",
|
|
"span": {
|
|
"start": 4089,
|
|
"end": 4114,
|
|
"ctxt": 0
|
|
},
|
|
"operator": "??",
|
|
"left": {
|
|
"type": "OptionalChainingExpression",
|
|
"span": {
|
|
"start": 4089,
|
|
"end": 4100,
|
|
"ctxt": 0
|
|
},
|
|
"questionDotToken": {
|
|
"start": 4092,
|
|
"end": 4093,
|
|
"ctxt": 0
|
|
},
|
|
"expr": {
|
|
"type": "MemberExpression",
|
|
"span": {
|
|
"start": 4089,
|
|
"end": 4100,
|
|
"ctxt": 0
|
|
},
|
|
"object": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 4089,
|
|
"end": 4092,
|
|
"ctxt": 0
|
|
},
|
|
"value": "zoo",
|
|
"optional": false
|
|
},
|
|
"property": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 4094,
|
|
"end": 4100,
|
|
"ctxt": 0
|
|
},
|
|
"value": "animal",
|
|
"optional": false
|
|
}
|
|
}
|
|
},
|
|
"right": {
|
|
"type": "MemberExpression",
|
|
"span": {
|
|
"start": 4104,
|
|
"end": 4114,
|
|
"ctxt": 0
|
|
},
|
|
"object": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 4104,
|
|
"end": 4110,
|
|
"ctxt": 0
|
|
},
|
|
"value": "Animal",
|
|
"optional": false
|
|
},
|
|
"property": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 4111,
|
|
"end": 4114,
|
|
"ctxt": 0
|
|
},
|
|
"value": "DOG",
|
|
"optional": false
|
|
}
|
|
}
|
|
},
|
|
"cases": [
|
|
{
|
|
"type": "SwitchCase",
|
|
"span": {
|
|
"start": 4126,
|
|
"end": 4160,
|
|
"ctxt": 0
|
|
},
|
|
"test": {
|
|
"type": "MemberExpression",
|
|
"span": {
|
|
"start": 4131,
|
|
"end": 4141,
|
|
"ctxt": 0
|
|
},
|
|
"object": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 4131,
|
|
"end": 4137,
|
|
"ctxt": 0
|
|
},
|
|
"value": "Animal",
|
|
"optional": false
|
|
},
|
|
"property": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 4138,
|
|
"end": 4141,
|
|
"ctxt": 0
|
|
},
|
|
"value": "DOG",
|
|
"optional": false
|
|
}
|
|
},
|
|
"consequent": [
|
|
{
|
|
"type": "ReturnStatement",
|
|
"span": {
|
|
"start": 4143,
|
|
"end": 4160,
|
|
"ctxt": 0
|
|
},
|
|
"argument": {
|
|
"type": "MemberExpression",
|
|
"span": {
|
|
"start": 4150,
|
|
"end": 4160,
|
|
"ctxt": 0
|
|
},
|
|
"object": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 4150,
|
|
"end": 4156,
|
|
"ctxt": 0
|
|
},
|
|
"value": "Animal",
|
|
"optional": false
|
|
},
|
|
"property": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 4157,
|
|
"end": 4160,
|
|
"ctxt": 0
|
|
},
|
|
"value": "DOG",
|
|
"optional": false
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "SwitchCase",
|
|
"span": {
|
|
"start": 4169,
|
|
"end": 4203,
|
|
"ctxt": 0
|
|
},
|
|
"test": {
|
|
"type": "MemberExpression",
|
|
"span": {
|
|
"start": 4174,
|
|
"end": 4184,
|
|
"ctxt": 0
|
|
},
|
|
"object": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 4174,
|
|
"end": 4180,
|
|
"ctxt": 0
|
|
},
|
|
"value": "Animal",
|
|
"optional": false
|
|
},
|
|
"property": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 4181,
|
|
"end": 4184,
|
|
"ctxt": 0
|
|
},
|
|
"value": "CAT",
|
|
"optional": false
|
|
}
|
|
},
|
|
"consequent": [
|
|
{
|
|
"type": "ReturnStatement",
|
|
"span": {
|
|
"start": 4186,
|
|
"end": 4203,
|
|
"ctxt": 0
|
|
},
|
|
"argument": {
|
|
"type": "MemberExpression",
|
|
"span": {
|
|
"start": 4193,
|
|
"end": 4203,
|
|
"ctxt": 0
|
|
},
|
|
"object": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 4193,
|
|
"end": 4199,
|
|
"ctxt": 0
|
|
},
|
|
"value": "Animal",
|
|
"optional": false
|
|
},
|
|
"property": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 4200,
|
|
"end": 4203,
|
|
"ctxt": 0
|
|
},
|
|
"value": "CAT",
|
|
"optional": false
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"generator": false,
|
|
"async": false,
|
|
"typeParameters": null,
|
|
"returnType": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 4066,
|
|
"end": 4074,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsTypeReference",
|
|
"span": {
|
|
"start": 4068,
|
|
"end": 4074,
|
|
"ctxt": 0
|
|
},
|
|
"typeName": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 4068,
|
|
"end": 4074,
|
|
"ctxt": 0
|
|
},
|
|
"value": "Animal",
|
|
"optional": false
|
|
},
|
|
"typeParams": null
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"type": "FunctionDeclaration",
|
|
"identifier": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 4244,
|
|
"end": 4247,
|
|
"ctxt": 0
|
|
},
|
|
"value": "foo",
|
|
"optional": false
|
|
},
|
|
"declare": false,
|
|
"params": [],
|
|
"decorators": [],
|
|
"span": {
|
|
"start": 4235,
|
|
"end": 4433,
|
|
"ctxt": 0
|
|
},
|
|
"body": {
|
|
"type": "BlockStatement",
|
|
"span": {
|
|
"start": 4250,
|
|
"end": 4433,
|
|
"ctxt": 0
|
|
},
|
|
"stmts": [
|
|
{
|
|
"type": "VariableDeclaration",
|
|
"span": {
|
|
"start": 4256,
|
|
"end": 4290,
|
|
"ctxt": 0
|
|
},
|
|
"kind": "const",
|
|
"declare": false,
|
|
"declarations": [
|
|
{
|
|
"type": "VariableDeclarator",
|
|
"span": {
|
|
"start": 4262,
|
|
"end": 4289,
|
|
"ctxt": 0
|
|
},
|
|
"id": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 4262,
|
|
"end": 4265,
|
|
"ctxt": 0
|
|
},
|
|
"value": "foo",
|
|
"optional": false,
|
|
"typeAnnotation": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 4265,
|
|
"end": 4285,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsUnionType",
|
|
"span": {
|
|
"start": 4267,
|
|
"end": 4285,
|
|
"ctxt": 0
|
|
},
|
|
"types": [
|
|
{
|
|
"type": "TsKeywordType",
|
|
"span": {
|
|
"start": 4267,
|
|
"end": 4273,
|
|
"ctxt": 0
|
|
},
|
|
"kind": "number"
|
|
},
|
|
{
|
|
"type": "TsKeywordType",
|
|
"span": {
|
|
"start": 4276,
|
|
"end": 4285,
|
|
"ctxt": 0
|
|
},
|
|
"kind": "undefined"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"init": {
|
|
"type": "NumericLiteral",
|
|
"span": {
|
|
"start": 4288,
|
|
"end": 4289,
|
|
"ctxt": 0
|
|
},
|
|
"value": 0.0
|
|
},
|
|
"definite": false
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "WhileStatement",
|
|
"span": {
|
|
"start": 4295,
|
|
"end": 4431,
|
|
"ctxt": 0
|
|
},
|
|
"test": {
|
|
"type": "BooleanLiteral",
|
|
"span": {
|
|
"start": 4302,
|
|
"end": 4306,
|
|
"ctxt": 0
|
|
},
|
|
"value": true
|
|
},
|
|
"body": {
|
|
"type": "BlockStatement",
|
|
"span": {
|
|
"start": 4308,
|
|
"end": 4431,
|
|
"ctxt": 0
|
|
},
|
|
"stmts": [
|
|
{
|
|
"type": "VariableDeclaration",
|
|
"span": {
|
|
"start": 4318,
|
|
"end": 4336,
|
|
"ctxt": 0
|
|
},
|
|
"kind": "const",
|
|
"declare": false,
|
|
"declarations": [
|
|
{
|
|
"type": "VariableDeclarator",
|
|
"span": {
|
|
"start": 4324,
|
|
"end": 4335,
|
|
"ctxt": 0
|
|
},
|
|
"id": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 4324,
|
|
"end": 4329,
|
|
"ctxt": 0
|
|
},
|
|
"value": "stats",
|
|
"optional": false,
|
|
"typeAnnotation": null
|
|
},
|
|
"init": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 4332,
|
|
"end": 4335,
|
|
"ctxt": 0
|
|
},
|
|
"value": "foo",
|
|
"optional": false
|
|
},
|
|
"definite": false
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "SwitchStatement",
|
|
"span": {
|
|
"start": 4345,
|
|
"end": 4425,
|
|
"ctxt": 0
|
|
},
|
|
"discriminant": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 4353,
|
|
"end": 4358,
|
|
"ctxt": 0
|
|
},
|
|
"value": "stats",
|
|
"optional": false
|
|
},
|
|
"cases": [
|
|
{
|
|
"type": "SwitchCase",
|
|
"span": {
|
|
"start": 4374,
|
|
"end": 4388,
|
|
"ctxt": 0
|
|
},
|
|
"test": {
|
|
"type": "NumericLiteral",
|
|
"span": {
|
|
"start": 4379,
|
|
"end": 4380,
|
|
"ctxt": 0
|
|
},
|
|
"value": 1.0
|
|
},
|
|
"consequent": [
|
|
{
|
|
"type": "BreakStatement",
|
|
"span": {
|
|
"start": 4382,
|
|
"end": 4388,
|
|
"ctxt": 0
|
|
},
|
|
"label": null
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "SwitchCase",
|
|
"span": {
|
|
"start": 4401,
|
|
"end": 4415,
|
|
"ctxt": 0
|
|
},
|
|
"test": {
|
|
"type": "NumericLiteral",
|
|
"span": {
|
|
"start": 4406,
|
|
"end": 4407,
|
|
"ctxt": 0
|
|
},
|
|
"value": 2.0
|
|
},
|
|
"consequent": [
|
|
{
|
|
"type": "BreakStatement",
|
|
"span": {
|
|
"start": 4409,
|
|
"end": 4415,
|
|
"ctxt": 0
|
|
},
|
|
"label": null
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"generator": false,
|
|
"async": false,
|
|
"typeParameters": null,
|
|
"returnType": null
|
|
},
|
|
{
|
|
"type": "TsTypeAliasDeclaration",
|
|
"span": {
|
|
"start": 4457,
|
|
"end": 4499,
|
|
"ctxt": 0
|
|
},
|
|
"declare": false,
|
|
"id": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 4462,
|
|
"end": 4463,
|
|
"ctxt": 0
|
|
},
|
|
"value": "O",
|
|
"optional": false
|
|
},
|
|
"typeParams": null,
|
|
"typeAnnotation": {
|
|
"type": "TsTypeLiteral",
|
|
"span": {
|
|
"start": 4466,
|
|
"end": 4498,
|
|
"ctxt": 0
|
|
},
|
|
"members": [
|
|
{
|
|
"type": "TsPropertySignature",
|
|
"span": {
|
|
"start": 4472,
|
|
"end": 4482,
|
|
"ctxt": 0
|
|
},
|
|
"readonly": false,
|
|
"key": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 4472,
|
|
"end": 4473,
|
|
"ctxt": 0
|
|
},
|
|
"value": "a",
|
|
"optional": false
|
|
},
|
|
"computed": false,
|
|
"optional": false,
|
|
"init": null,
|
|
"params": [],
|
|
"typeAnnotation": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 4473,
|
|
"end": 4481,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsKeywordType",
|
|
"span": {
|
|
"start": 4475,
|
|
"end": 4481,
|
|
"ctxt": 0
|
|
},
|
|
"kind": "number"
|
|
}
|
|
},
|
|
"typeParams": null
|
|
},
|
|
{
|
|
"type": "TsPropertySignature",
|
|
"span": {
|
|
"start": 4487,
|
|
"end": 4496,
|
|
"ctxt": 0
|
|
},
|
|
"readonly": false,
|
|
"key": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 4487,
|
|
"end": 4488,
|
|
"ctxt": 0
|
|
},
|
|
"value": "b",
|
|
"optional": false
|
|
},
|
|
"computed": false,
|
|
"optional": false,
|
|
"init": null,
|
|
"params": [],
|
|
"typeAnnotation": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 4488,
|
|
"end": 4496,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsKeywordType",
|
|
"span": {
|
|
"start": 4490,
|
|
"end": 4496,
|
|
"ctxt": 0
|
|
},
|
|
"kind": "number"
|
|
}
|
|
},
|
|
"typeParams": null
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "TsTypeAliasDeclaration",
|
|
"span": {
|
|
"start": 4500,
|
|
"end": 4523,
|
|
"ctxt": 0
|
|
},
|
|
"declare": false,
|
|
"id": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 4505,
|
|
"end": 4506,
|
|
"ctxt": 0
|
|
},
|
|
"value": "K",
|
|
"optional": false
|
|
},
|
|
"typeParams": null,
|
|
"typeAnnotation": {
|
|
"type": "TsUnionType",
|
|
"span": {
|
|
"start": 4509,
|
|
"end": 4522,
|
|
"ctxt": 0
|
|
},
|
|
"types": [
|
|
{
|
|
"type": "TsTypeOperator",
|
|
"span": {
|
|
"start": 4509,
|
|
"end": 4516,
|
|
"ctxt": 0
|
|
},
|
|
"op": "keyof",
|
|
"typeAnnotation": {
|
|
"type": "TsTypeReference",
|
|
"span": {
|
|
"start": 4515,
|
|
"end": 4516,
|
|
"ctxt": 0
|
|
},
|
|
"typeName": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 4515,
|
|
"end": 4516,
|
|
"ctxt": 0
|
|
},
|
|
"value": "O",
|
|
"optional": false
|
|
},
|
|
"typeParams": null
|
|
}
|
|
},
|
|
{
|
|
"type": "TsLiteralType",
|
|
"span": {
|
|
"start": 4519,
|
|
"end": 4522,
|
|
"ctxt": 0
|
|
},
|
|
"literal": {
|
|
"type": "StringLiteral",
|
|
"span": {
|
|
"start": 4519,
|
|
"end": 4522,
|
|
"ctxt": 0
|
|
},
|
|
"value": "c",
|
|
"hasEscape": false,
|
|
"kind": {
|
|
"type": "normal",
|
|
"containsQuote": true
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "FunctionDeclaration",
|
|
"identifier": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 4533,
|
|
"end": 4535,
|
|
"ctxt": 0
|
|
},
|
|
"value": "ff",
|
|
"optional": false
|
|
},
|
|
"declare": false,
|
|
"params": [
|
|
{
|
|
"type": "Parameter",
|
|
"span": {
|
|
"start": 4536,
|
|
"end": 4540,
|
|
"ctxt": 0
|
|
},
|
|
"decorators": [],
|
|
"pat": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 4536,
|
|
"end": 4540,
|
|
"ctxt": 0
|
|
},
|
|
"value": "o",
|
|
"optional": false,
|
|
"typeAnnotation": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 4537,
|
|
"end": 4540,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsTypeReference",
|
|
"span": {
|
|
"start": 4539,
|
|
"end": 4540,
|
|
"ctxt": 0
|
|
},
|
|
"typeName": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 4539,
|
|
"end": 4540,
|
|
"ctxt": 0
|
|
},
|
|
"value": "O",
|
|
"optional": false
|
|
},
|
|
"typeParams": null
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"type": "Parameter",
|
|
"span": {
|
|
"start": 4542,
|
|
"end": 4546,
|
|
"ctxt": 0
|
|
},
|
|
"decorators": [],
|
|
"pat": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 4542,
|
|
"end": 4546,
|
|
"ctxt": 0
|
|
},
|
|
"value": "k",
|
|
"optional": false,
|
|
"typeAnnotation": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 4543,
|
|
"end": 4546,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsTypeReference",
|
|
"span": {
|
|
"start": 4545,
|
|
"end": 4546,
|
|
"ctxt": 0
|
|
},
|
|
"typeName": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 4545,
|
|
"end": 4546,
|
|
"ctxt": 0
|
|
},
|
|
"value": "K",
|
|
"optional": false
|
|
},
|
|
"typeParams": null
|
|
}
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"decorators": [],
|
|
"span": {
|
|
"start": 4524,
|
|
"end": 4654,
|
|
"ctxt": 0
|
|
},
|
|
"body": {
|
|
"type": "BlockStatement",
|
|
"span": {
|
|
"start": 4548,
|
|
"end": 4654,
|
|
"ctxt": 0
|
|
},
|
|
"stmts": [
|
|
{
|
|
"type": "SwitchStatement",
|
|
"span": {
|
|
"start": 4554,
|
|
"end": 4610,
|
|
"ctxt": 0
|
|
},
|
|
"discriminant": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 4561,
|
|
"end": 4562,
|
|
"ctxt": 0
|
|
},
|
|
"value": "k",
|
|
"optional": false
|
|
},
|
|
"cases": [
|
|
{
|
|
"type": "SwitchCase",
|
|
"span": {
|
|
"start": 4574,
|
|
"end": 4604,
|
|
"ctxt": 0
|
|
},
|
|
"test": {
|
|
"type": "StringLiteral",
|
|
"span": {
|
|
"start": 4579,
|
|
"end": 4582,
|
|
"ctxt": 0
|
|
},
|
|
"value": "c",
|
|
"hasEscape": false,
|
|
"kind": {
|
|
"type": "normal",
|
|
"containsQuote": true
|
|
}
|
|
},
|
|
"consequent": [
|
|
{
|
|
"type": "ExpressionStatement",
|
|
"span": {
|
|
"start": 4596,
|
|
"end": 4604,
|
|
"ctxt": 0
|
|
},
|
|
"expression": {
|
|
"type": "AssignmentExpression",
|
|
"span": {
|
|
"start": 4596,
|
|
"end": 4603,
|
|
"ctxt": 0
|
|
},
|
|
"operator": "=",
|
|
"left": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 4596,
|
|
"end": 4597,
|
|
"ctxt": 0
|
|
},
|
|
"value": "k",
|
|
"optional": false,
|
|
"typeAnnotation": null
|
|
},
|
|
"right": {
|
|
"type": "StringLiteral",
|
|
"span": {
|
|
"start": 4600,
|
|
"end": 4603,
|
|
"ctxt": 0
|
|
},
|
|
"value": "a",
|
|
"hasEscape": false,
|
|
"kind": {
|
|
"type": "normal",
|
|
"containsQuote": true
|
|
}
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "ExpressionStatement",
|
|
"span": {
|
|
"start": 4615,
|
|
"end": 4625,
|
|
"ctxt": 0
|
|
},
|
|
"expression": {
|
|
"type": "BinaryExpression",
|
|
"span": {
|
|
"start": 4615,
|
|
"end": 4624,
|
|
"ctxt": 0
|
|
},
|
|
"operator": "===",
|
|
"left": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 4615,
|
|
"end": 4616,
|
|
"ctxt": 0
|
|
},
|
|
"value": "k",
|
|
"optional": false
|
|
},
|
|
"right": {
|
|
"type": "StringLiteral",
|
|
"span": {
|
|
"start": 4621,
|
|
"end": 4624,
|
|
"ctxt": 0
|
|
},
|
|
"value": "c",
|
|
"hasEscape": false,
|
|
"kind": {
|
|
"type": "normal",
|
|
"containsQuote": true
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"type": "ReturnStatement",
|
|
"span": {
|
|
"start": 4640,
|
|
"end": 4652,
|
|
"ctxt": 0
|
|
},
|
|
"argument": {
|
|
"type": "MemberExpression",
|
|
"span": {
|
|
"start": 4647,
|
|
"end": 4651,
|
|
"ctxt": 0
|
|
},
|
|
"object": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 4647,
|
|
"end": 4648,
|
|
"ctxt": 0
|
|
},
|
|
"value": "o",
|
|
"optional": false
|
|
},
|
|
"property": {
|
|
"type": "Computed",
|
|
"span": {
|
|
"start": 4648,
|
|
"end": 4651,
|
|
"ctxt": 0
|
|
},
|
|
"expression": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 4649,
|
|
"end": 4650,
|
|
"ctxt": 0
|
|
},
|
|
"value": "k",
|
|
"optional": false
|
|
}
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"generator": false,
|
|
"async": false,
|
|
"typeParameters": null,
|
|
"returnType": null
|
|
},
|
|
{
|
|
"type": "TsTypeAliasDeclaration",
|
|
"span": {
|
|
"start": 4677,
|
|
"end": 4720,
|
|
"ctxt": 0
|
|
},
|
|
"declare": false,
|
|
"id": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 4682,
|
|
"end": 4683,
|
|
"ctxt": 0
|
|
},
|
|
"value": "A",
|
|
"optional": false
|
|
},
|
|
"typeParams": null,
|
|
"typeAnnotation": {
|
|
"type": "TsUnionType",
|
|
"span": {
|
|
"start": 4686,
|
|
"end": 4719,
|
|
"ctxt": 0
|
|
},
|
|
"types": [
|
|
{
|
|
"type": "TsTypeLiteral",
|
|
"span": {
|
|
"start": 4686,
|
|
"end": 4701,
|
|
"ctxt": 0
|
|
},
|
|
"members": [
|
|
{
|
|
"type": "TsPropertySignature",
|
|
"span": {
|
|
"start": 4688,
|
|
"end": 4699,
|
|
"ctxt": 0
|
|
},
|
|
"readonly": false,
|
|
"key": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 4688,
|
|
"end": 4692,
|
|
"ctxt": 0
|
|
},
|
|
"value": "kind",
|
|
"optional": false
|
|
},
|
|
"computed": false,
|
|
"optional": false,
|
|
"init": null,
|
|
"params": [],
|
|
"typeAnnotation": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 4692,
|
|
"end": 4699,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsLiteralType",
|
|
"span": {
|
|
"start": 4694,
|
|
"end": 4699,
|
|
"ctxt": 0
|
|
},
|
|
"literal": {
|
|
"type": "StringLiteral",
|
|
"span": {
|
|
"start": 4694,
|
|
"end": 4699,
|
|
"ctxt": 0
|
|
},
|
|
"value": "abc",
|
|
"hasEscape": false,
|
|
"kind": {
|
|
"type": "normal",
|
|
"containsQuote": true
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"typeParams": null
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "TsTypeLiteral",
|
|
"span": {
|
|
"start": 4704,
|
|
"end": 4719,
|
|
"ctxt": 0
|
|
},
|
|
"members": [
|
|
{
|
|
"type": "TsPropertySignature",
|
|
"span": {
|
|
"start": 4706,
|
|
"end": 4717,
|
|
"ctxt": 0
|
|
},
|
|
"readonly": false,
|
|
"key": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 4706,
|
|
"end": 4710,
|
|
"ctxt": 0
|
|
},
|
|
"value": "kind",
|
|
"optional": false
|
|
},
|
|
"computed": false,
|
|
"optional": false,
|
|
"init": null,
|
|
"params": [],
|
|
"typeAnnotation": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 4710,
|
|
"end": 4717,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsLiteralType",
|
|
"span": {
|
|
"start": 4712,
|
|
"end": 4717,
|
|
"ctxt": 0
|
|
},
|
|
"literal": {
|
|
"type": "StringLiteral",
|
|
"span": {
|
|
"start": 4712,
|
|
"end": 4717,
|
|
"ctxt": 0
|
|
},
|
|
"value": "def",
|
|
"hasEscape": false,
|
|
"kind": {
|
|
"type": "normal",
|
|
"containsQuote": true
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"typeParams": null
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "FunctionDeclaration",
|
|
"identifier": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 4731,
|
|
"end": 4737,
|
|
"ctxt": 0
|
|
},
|
|
"value": "f35431",
|
|
"optional": false
|
|
},
|
|
"declare": false,
|
|
"params": [
|
|
{
|
|
"type": "Parameter",
|
|
"span": {
|
|
"start": 4738,
|
|
"end": 4742,
|
|
"ctxt": 0
|
|
},
|
|
"decorators": [],
|
|
"pat": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 4738,
|
|
"end": 4742,
|
|
"ctxt": 0
|
|
},
|
|
"value": "a",
|
|
"optional": false,
|
|
"typeAnnotation": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 4739,
|
|
"end": 4742,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsTypeReference",
|
|
"span": {
|
|
"start": 4741,
|
|
"end": 4742,
|
|
"ctxt": 0
|
|
},
|
|
"typeName": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 4741,
|
|
"end": 4742,
|
|
"ctxt": 0
|
|
},
|
|
"value": "A",
|
|
"optional": false
|
|
},
|
|
"typeParams": null
|
|
}
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"decorators": [],
|
|
"span": {
|
|
"start": 4722,
|
|
"end": 4857,
|
|
"ctxt": 0
|
|
},
|
|
"body": {
|
|
"type": "BlockStatement",
|
|
"span": {
|
|
"start": 4744,
|
|
"end": 4857,
|
|
"ctxt": 0
|
|
},
|
|
"stmts": [
|
|
{
|
|
"type": "SwitchStatement",
|
|
"span": {
|
|
"start": 4748,
|
|
"end": 4855,
|
|
"ctxt": 0
|
|
},
|
|
"discriminant": {
|
|
"type": "MemberExpression",
|
|
"span": {
|
|
"start": 4756,
|
|
"end": 4762,
|
|
"ctxt": 0
|
|
},
|
|
"object": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 4756,
|
|
"end": 4757,
|
|
"ctxt": 0
|
|
},
|
|
"value": "a",
|
|
"optional": false
|
|
},
|
|
"property": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 4758,
|
|
"end": 4762,
|
|
"ctxt": 0
|
|
},
|
|
"value": "kind",
|
|
"optional": false
|
|
}
|
|
},
|
|
"cases": [
|
|
{
|
|
"type": "SwitchCase",
|
|
"span": {
|
|
"start": 4770,
|
|
"end": 4781,
|
|
"ctxt": 0
|
|
},
|
|
"test": {
|
|
"type": "StringLiteral",
|
|
"span": {
|
|
"start": 4775,
|
|
"end": 4780,
|
|
"ctxt": 0
|
|
},
|
|
"value": "abc",
|
|
"hasEscape": false,
|
|
"kind": {
|
|
"type": "normal",
|
|
"containsQuote": true
|
|
}
|
|
},
|
|
"consequent": []
|
|
},
|
|
{
|
|
"type": "SwitchCase",
|
|
"span": {
|
|
"start": 4786,
|
|
"end": 4805,
|
|
"ctxt": 0
|
|
},
|
|
"test": {
|
|
"type": "StringLiteral",
|
|
"span": {
|
|
"start": 4791,
|
|
"end": 4796,
|
|
"ctxt": 0
|
|
},
|
|
"value": "def",
|
|
"hasEscape": false,
|
|
"kind": {
|
|
"type": "normal",
|
|
"containsQuote": true
|
|
}
|
|
},
|
|
"consequent": [
|
|
{
|
|
"type": "ReturnStatement",
|
|
"span": {
|
|
"start": 4798,
|
|
"end": 4805,
|
|
"ctxt": 0
|
|
},
|
|
"argument": null
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "SwitchCase",
|
|
"span": {
|
|
"start": 4810,
|
|
"end": 4833,
|
|
"ctxt": 0
|
|
},
|
|
"test": null,
|
|
"consequent": [
|
|
{
|
|
"type": "ExpressionStatement",
|
|
"span": {
|
|
"start": 4825,
|
|
"end": 4833,
|
|
"ctxt": 0
|
|
},
|
|
"expression": {
|
|
"type": "MemberExpression",
|
|
"span": {
|
|
"start": 4825,
|
|
"end": 4832,
|
|
"ctxt": 0
|
|
},
|
|
"object": {
|
|
"type": "TsNonNullExpression",
|
|
"span": {
|
|
"start": 4825,
|
|
"end": 4827,
|
|
"ctxt": 0
|
|
},
|
|
"expression": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 4825,
|
|
"end": 4826,
|
|
"ctxt": 0
|
|
},
|
|
"value": "a",
|
|
"optional": false
|
|
}
|
|
},
|
|
"property": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 4828,
|
|
"end": 4832,
|
|
"ctxt": 0
|
|
},
|
|
"value": "kind",
|
|
"optional": false
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"generator": false,
|
|
"async": false,
|
|
"typeParameters": null,
|
|
"returnType": null
|
|
}
|
|
],
|
|
"interpreter": null
|
|
}
|