UNPKG

@reactivex/rxjs

Version:

Reactive Extensions for modern JavaScript

1,394 lines (1,393 loc) 702 kB
{ "type": "Program", "body": [ { "type": "ImportDeclaration", "specifiers": [ { "type": "ImportSpecifier", "local": { "type": "Identifier", "name": "isFunction", "range": [ 9, 19 ], "loc": { "start": { "line": 1, "column": 9 }, "end": { "line": 1, "column": 19 } } }, "imported": { "type": "Identifier", "name": "isFunction", "range": [ 9, 19 ], "loc": { "start": { "line": 1, "column": 9 }, "end": { "line": 1, "column": 19 } } }, "range": [ 9, 19 ], "loc": { "start": { "line": 1, "column": 9 }, "end": { "line": 1, "column": 19 } } } ], "source": { "type": "Literal", "value": "./util/isFunction", "raw": "'./util/isFunction'", "range": [ 27, 46 ], "loc": { "start": { "line": 1, "column": 27 }, "end": { "line": 1, "column": 46 } } }, "range": [ 0, 47 ], "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 1, "column": 47 } } }, { "type": "ImportDeclaration", "specifiers": [ { "type": "ImportSpecifier", "local": { "type": "Identifier", "name": "Subscription", "range": [ 57, 69 ], "loc": { "start": { "line": 2, "column": 9 }, "end": { "line": 2, "column": 21 } } }, "imported": { "type": "Identifier", "name": "Subscription", "range": [ 57, 69 ], "loc": { "start": { "line": 2, "column": 9 }, "end": { "line": 2, "column": 21 } } }, "range": [ 57, 69 ], "loc": { "start": { "line": 2, "column": 9 }, "end": { "line": 2, "column": 21 } } } ], "source": { "type": "Literal", "value": "./Subscription", "raw": "'./Subscription'", "range": [ 77, 93 ], "loc": { "start": { "line": 2, "column": 29 }, "end": { "line": 2, "column": 45 } } }, "range": [ 48, 94 ], "loc": { "start": { "line": 2, "column": 0 }, "end": { "line": 2, "column": 46 } } }, { "type": "ImportDeclaration", "specifiers": [ { "type": "ImportSpecifier", "local": { "type": "Identifier", "name": "emptyObserver", "range": [ 113, 126 ], "loc": { "start": { "line": 3, "column": 18 }, "end": { "line": 3, "column": 31 } } }, "imported": { "type": "Identifier", "name": "empty", "range": [ 104, 109 ], "loc": { "start": { "line": 3, "column": 9 }, "end": { "line": 3, "column": 14 } } }, "range": [ 104, 126 ], "loc": { "start": { "line": 3, "column": 9 }, "end": { "line": 3, "column": 31 } } } ], "source": { "type": "Literal", "value": "./Observer", "raw": "'./Observer'", "range": [ 134, 146 ], "loc": { "start": { "line": 3, "column": 39 }, "end": { "line": 3, "column": 51 } } }, "range": [ 95, 147 ], "loc": { "start": { "line": 3, "column": 0 }, "end": { "line": 3, "column": 52 } } }, { "type": "ImportDeclaration", "specifiers": [ { "type": "ImportSpecifier", "local": { "type": "Identifier", "name": "$$rxSubscriber", "range": [ 157, 171 ], "loc": { "start": { "line": 4, "column": 9 }, "end": { "line": 4, "column": 23 } } }, "imported": { "type": "Identifier", "name": "$$rxSubscriber", "range": [ 157, 171 ], "loc": { "start": { "line": 4, "column": 9 }, "end": { "line": 4, "column": 23 } } }, "range": [ 157, 171 ], "loc": { "start": { "line": 4, "column": 9 }, "end": { "line": 4, "column": 23 } } } ], "source": { "type": "Literal", "value": "./symbol/rxSubscriber", "raw": "'./symbol/rxSubscriber'", "range": [ 179, 202 ], "loc": { "start": { "line": 4, "column": 31 }, "end": { "line": 4, "column": 54 } } }, "range": [ 148, 203 ], "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 4, "column": 55 } }, "trailingComments": [ { "type": "Block", "value": "*\n * Implements the {@link Observer} interface and extends the\n * {@link Subscription} class. While the {@link Observer} is the public API for\n * consuming the values of an {@link Observable}, all Observers get converted to\n * a Subscriber, in order to provide Subscription-like capabilities such as\n * `unsubscribe`. Subscriber is a common type in RxJS, and crucial for\n * implementing operators, but it is rarely used as a public API.\n *\n * @class Subscriber<T>\n ", "range": [ 204, 673 ], "loc": { "start": { "line": 5, "column": 0 }, "end": { "line": 14, "column": 3 } } } ] }, { "type": "ExportNamedDeclaration", "declaration": { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "Subscriber", "range": [ 685, 695 ], "loc": { "start": { "line": 15, "column": 11 }, "end": { "line": 15, "column": 21 } } }, "init": { "type": "CallExpression", "callee": { "type": "FunctionExpression", "id": null, "params": [ { "type": "Identifier", "name": "_super", "range": [ 709, 715 ], "loc": { "start": { "line": 15, "column": 35 }, "end": { "line": 15, "column": 41 } } } ], "body": { "type": "BlockStatement", "body": [ { "type": "ExpressionStatement", "expression": { "type": "CallExpression", "callee": { "type": "Identifier", "name": "__extends", "range": [ 723, 732 ], "loc": { "start": { "line": 16, "column": 4 }, "end": { "line": 16, "column": 13 } } }, "arguments": [ { "type": "Identifier", "name": "Subscriber", "range": [ 733, 743 ], "loc": { "start": { "line": 16, "column": 14 }, "end": { "line": 16, "column": 24 } } }, { "type": "Identifier", "name": "_super", "range": [ 745, 751 ], "loc": { "start": { "line": 16, "column": 26 }, "end": { "line": 16, "column": 32 } } } ], "range": [ 723, 752 ], "loc": { "start": { "line": 16, "column": 4 }, "end": { "line": 16, "column": 33 } } }, "range": [ 723, 753 ], "loc": { "start": { "line": 16, "column": 4 }, "end": { "line": 16, "column": 34 } }, "trailingComments": [ { "type": "Block", "value": "*\n * @param {Observer|function(value: T): void} [destinationOrNext] A partially\n * defined Observer or a `next` callback function.\n * @param {function(e: ?any): void} [error] The `error` callback of an\n * Observer.\n * @param {function(): void} [complete] The `complete` callback of an\n * Observer.\n ", "range": [ 758, 1089 ], "loc": { "start": { "line": 17, "column": 4 }, "end": { "line": 24, "column": 7 } } } ] }, { "type": "FunctionDeclaration", "id": { "type": "Identifier", "name": "Subscriber", "range": [ 1103, 1113 ], "loc": { "start": { "line": 25, "column": 13 }, "end": { "line": 25, "column": 23 } } }, "params": [ { "type": "Identifier", "name": "destinationOrNext", "range": [ 1114, 1131 ], "loc": { "start": { "line": 25, "column": 24 }, "end": { "line": 25, "column": 41 } } }, { "type": "Identifier", "name": "error", "range": [ 1133, 1138 ], "loc": { "start": { "line": 25, "column": 43 }, "end": { "line": 25, "column": 48 } } }, { "type": "Identifier", "name": "complete", "range": [ 1140, 1148 ], "loc": { "start": { "line": 25, "column": 50 }, "end": { "line": 25, "column": 58 } } } ], "body": { "type": "BlockStatement", "body": [ { "type": "ExpressionStatement", "expression": { "type": "CallExpression", "callee": { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "_super", "range": [ 1160, 1166 ], "loc": { "start": { "line": 26, "column": 8 }, "end": { "line": 26, "column": 14 } } }, "property": { "type": "Identifier", "name": "call", "range": [ 1167, 1171 ], "loc": { "start": { "line": 26, "column": 15 }, "end": { "line": 26, "column": 19 } } }, "range": [ 1160, 1171 ], "loc": { "start": { "line": 26, "column": 8 }, "end": { "line": 26, "column": 19 } } }, "arguments": [ { "type": "ThisExpression", "range": [ 1172, 1176 ], "loc": { "start": { "line": 26, "column": 20 }, "end": { "line": 26, "column": 24 } } } ], "range": [ 1160, 1177 ], "loc": { "start": { "line": 26, "column": 8 }, "end": { "line": 26, "column": 25 } } }, "range": [ 1160, 1178 ], "loc": { "start": { "line": 26, "column": 8 }, "end": { "line": 26, "column": 26 } } }, { "type": "ExpressionStatement", "expression": { "type": "AssignmentExpression", "operator": "=", "left": { "type": "MemberExpression", "computed": false, "object": { "type": "ThisExpression", "range": [ 1187, 1191 ], "loc": { "start": { "line": 27, "column": 8 }, "end": { "line": 27, "column": 12 } } }, "property": { "type": "Identifier", "name": "syncErrorValue", "range": [ 1192, 1206 ], "loc": { "start": { "line": 27, "column": 13 }, "end": { "line": 27, "column": 27 } } }, "range": [ 1187, 1206 ], "loc": { "start": { "line": 27, "column": 8 }, "end": { "line": 27, "column": 27 } } }, "right": { "type": "Literal", "value": null, "raw": "null", "range": [ 1209, 1213 ], "loc": { "start": { "line": 27, "column": 30 }, "end": { "line": 27, "column": 34 } } }, "range": [ 1187, 1213 ], "loc": { "start": { "line": 27, "column": 8 }, "end": { "line": 27, "column": 34 } } }, "range": [ 1187, 1214 ], "loc": { "start": { "line": 27, "column": 8 }, "end": { "line": 27, "column": 35 } } }, { "type": "ExpressionStatement", "expression": { "type": "AssignmentExpression", "operator": "=", "left": { "type": "MemberExpression", "computed": false, "object": { "type": "ThisExpression", "range": [ 1223, 1227 ], "loc": { "start": { "line": 28, "column": 8 }, "end": { "line": 28, "column": 12 } } }, "property": { "type": "Identifier", "name": "syncErrorThrown", "range": [ 1228, 1243 ], "loc": { "start": { "line": 28, "column": 13 }, "end": { "line": 28, "column": 28 } } }, "range": [ 1223, 1243 ], "loc": { "start": { "line": 28, "column": 8 }, "end": { "line": 28, "column": 28 } } }, "right": { "type": "Literal", "value": false, "raw": "false", "range": [ 1246, 1251 ], "loc": { "start": { "line": 28, "column": 31 }, "end": { "line": 28, "column": 36 } } }, "range": [ 1223, 1251 ], "loc": { "start": { "line": 28, "column": 8 }, "end": { "line": 28, "column": 36 } } }, "range": [ 1223, 1252 ], "loc": { "start": { "line": 28, "column": 8 }, "end": { "line": 28, "column": 37 } } }, { "type": "ExpressionStatement", "expression": { "type": "AssignmentExpression", "operator": "=", "left": { "type": "MemberExpression", "computed": false, "object": { "type": "ThisExpression", "range": [ 1261, 1265 ], "loc": { "start": { "line": 29, "column": 8 }, "end": { "line": 29, "column": 12 } } }, "property": { "type": "Identifier", "name": "syncErrorThrowable", "range": [ 1266, 1284 ], "loc": { "start": { "line": 29, "column": 13 }, "end": { "line": 29, "column": 31 } } }, "range": [ 1261, 1284 ], "loc": { "start": { "line": 29, "column": 8 }, "end": { "line": 29, "column": 31 } } }, "right": { "type": "Literal", "value": false, "raw": "false", "range": [ 1287, 1292 ], "loc": { "start": { "line": 29, "column": 34 }, "end": { "line": 29, "column": 39 } } }, "range": [ 1261, 1292 ], "loc": { "start": { "line": 29, "column": 8 }, "end": { "line": 29, "column": 39 } } }, "range": [ 1261, 1293 ], "loc": { "start": { "line": 29, "column": 8 }, "end": { "line": 29, "column": 40 } } }, { "type": "ExpressionStatement", "expression": { "type": "AssignmentExpression", "operator": "=", "left": { "type": "MemberExpression", "computed": false, "object": { "type": "ThisExpression", "range": [ 1302, 1306 ], "loc": { "start": { "line": 30, "column": 8 }, "end": { "line": 30, "column": 12 } } }, "property": { "type": "Identifier", "name": "isStopped", "range": [ 1307, 1316 ], "loc": { "start": { "line": 30, "column": 13 }, "end": { "line": 30, "column": 22 } } }, "range": [ 1302, 1316 ], "loc": { "start": { "line": 30, "column": 8 }, "end": { "line": 30, "column": 22 } } }, "right": { "type": "Literal", "value": false, "raw": "false", "range": [ 1319, 1324 ], "loc": { "start": { "line": 30, "column": 25 }, "end": { "line": 30, "column": 30 } } }, "range": [ 1302, 1324 ], "loc": { "start": { "line": 30, "column": 8 }, "end": { "line": 30, "column": 30 } } }, "range": [ 1302, 1325 ], "loc": { "start": { "line": 30, "column": 8 }, "end": { "line": 30, "column": 31 } } }, { "type": "SwitchStatement", "discriminant": { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "arguments", "range": [ 1342, 1351 ], "loc": { "start": { "line": 31, "column": 16 }, "end": { "line": 31, "column": 25 } } }, "property": { "type": "Identifier", "name": "length", "range": [ 1352, 1358 ], "loc": { "start": { "line": 31, "column": 26 }, "end": { "line": 31, "column": 32 } } }, "range": [ 1342, 1358 ], "loc": { "start": { "line": 31, "column": 16 }, "end": { "line": 31, "column": 32 } } }, "cases": [ { "type": "SwitchCase", "test": { "type": "Literal", "value": 0, "raw": "0", "range": [ 1379, 1380 ], "loc": { "start": { "line": 32, "column": 17 }, "end": { "line": 32, "column": 18 } } }, "consequent": [ { "type": "ExpressionStatement", "expression": { "type": "AssignmentExpression", "operator": "=", "left": { "type": "MemberExpression", "computed": false, "object": { "type": "ThisExpression", "range": [ 1398, 1402 ], "loc": { "start": { "line": 33, "column": 16 }, "end": { "line": 33, "column": 20 } } }, "property": { "type": "Identifier", "name": "destination", "range": [ 1403, 1414 ], "loc": { "start": { "line": 33, "column": 21 }, "end": { "line": 33, "column": 32 } } }, "range": [ 1398, 1414 ], "loc": { "start": { "line": 33, "column": 16 }, "end": { "line": 33, "column": 32 } } }, "right": { "type": "Identifier", "name": "emptyObserver", "range": [ 1417, 1430 ], "loc": { "start": { "line": 33, "column": 35 }, "end": { "line": 33, "column": 48 } } }, "range": [ 1398, 1430 ], "loc": { "start": { "line": 33, "column": 16 }, "end": { "line": 33, "column": 48 } } }, "range": [ 1398, 1431 ], "loc": { "start": { "line": 33, "column": 16 }, "end": { "line": 33, "column": 49 } } }, { "type": "BreakStatement", "label": null, "range": [ 1448, 1454 ], "loc": { "start": { "line": 34, "column": 16 }, "end": { "line": 34, "column": 22 } } } ], "range": [ 1374, 1454 ], "loc": { "start": { "line": 32, "column": 12 }, "end": { "line": 34, "column": 22 } } }, { "type": "SwitchCase", "test": { "type": "Literal", "value": 1, "raw": "1", "range": [ 1472, 1473 ],