UNPKG

@reactivex/rxjs

Version:

Reactive Extensions for modern JavaScript

1,520 lines (1,519 loc) 321 kB
{ "type": "Program", "body": [ { "type": "ImportDeclaration", "specifiers": [ { "type": "ImportSpecifier", "local": { "type": "Identifier", "name": "Subject", "range": [ 9, 16 ], "loc": { "start": { "line": 1, "column": 9 }, "end": { "line": 1, "column": 16 } } }, "imported": { "type": "Identifier", "name": "Subject", "range": [ 9, 16 ], "loc": { "start": { "line": 1, "column": 9 }, "end": { "line": 1, "column": 16 } } }, "range": [ 9, 16 ], "loc": { "start": { "line": 1, "column": 9 }, "end": { "line": 1, "column": 16 } } } ], "source": { "type": "Literal", "value": "../Subject", "raw": "'../Subject'", "range": [ 24, 36 ], "loc": { "start": { "line": 1, "column": 24 }, "end": { "line": 1, "column": 36 } } }, "range": [ 0, 37 ], "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 1, "column": 37 } } }, { "type": "ImportDeclaration", "specifiers": [ { "type": "ImportSpecifier", "local": { "type": "Identifier", "name": "tryCatch", "range": [ 47, 55 ], "loc": { "start": { "line": 2, "column": 9 }, "end": { "line": 2, "column": 17 } } }, "imported": { "type": "Identifier", "name": "tryCatch", "range": [ 47, 55 ], "loc": { "start": { "line": 2, "column": 9 }, "end": { "line": 2, "column": 17 } } }, "range": [ 47, 55 ], "loc": { "start": { "line": 2, "column": 9 }, "end": { "line": 2, "column": 17 } } } ], "source": { "type": "Literal", "value": "../util/tryCatch", "raw": "'../util/tryCatch'", "range": [ 63, 81 ], "loc": { "start": { "line": 2, "column": 25 }, "end": { "line": 2, "column": 43 } } }, "range": [ 38, 82 ], "loc": { "start": { "line": 2, "column": 0 }, "end": { "line": 2, "column": 44 } } }, { "type": "ImportDeclaration", "specifiers": [ { "type": "ImportSpecifier", "local": { "type": "Identifier", "name": "errorObject", "range": [ 92, 103 ], "loc": { "start": { "line": 3, "column": 9 }, "end": { "line": 3, "column": 20 } } }, "imported": { "type": "Identifier", "name": "errorObject", "range": [ 92, 103 ], "loc": { "start": { "line": 3, "column": 9 }, "end": { "line": 3, "column": 20 } } }, "range": [ 92, 103 ], "loc": { "start": { "line": 3, "column": 9 }, "end": { "line": 3, "column": 20 } } } ], "source": { "type": "Literal", "value": "../util/errorObject", "raw": "'../util/errorObject'", "range": [ 111, 132 ], "loc": { "start": { "line": 3, "column": 28 }, "end": { "line": 3, "column": 49 } } }, "range": [ 83, 133 ], "loc": { "start": { "line": 3, "column": 0 }, "end": { "line": 3, "column": 50 } } }, { "type": "ImportDeclaration", "specifiers": [ { "type": "ImportSpecifier", "local": { "type": "Identifier", "name": "OuterSubscriber", "range": [ 143, 158 ], "loc": { "start": { "line": 4, "column": 9 }, "end": { "line": 4, "column": 24 } } }, "imported": { "type": "Identifier", "name": "OuterSubscriber", "range": [ 143, 158 ], "loc": { "start": { "line": 4, "column": 9 }, "end": { "line": 4, "column": 24 } } }, "range": [ 143, 158 ], "loc": { "start": { "line": 4, "column": 9 }, "end": { "line": 4, "column": 24 } } } ], "source": { "type": "Literal", "value": "../OuterSubscriber", "raw": "'../OuterSubscriber'", "range": [ 166, 186 ], "loc": { "start": { "line": 4, "column": 32 }, "end": { "line": 4, "column": 52 } } }, "range": [ 134, 187 ], "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 4, "column": 53 } } }, { "type": "ImportDeclaration", "specifiers": [ { "type": "ImportSpecifier", "local": { "type": "Identifier", "name": "subscribeToResult", "range": [ 197, 214 ], "loc": { "start": { "line": 5, "column": 9 }, "end": { "line": 5, "column": 26 } } }, "imported": { "type": "Identifier", "name": "subscribeToResult", "range": [ 197, 214 ], "loc": { "start": { "line": 5, "column": 9 }, "end": { "line": 5, "column": 26 } } }, "range": [ 197, 214 ], "loc": { "start": { "line": 5, "column": 9 }, "end": { "line": 5, "column": 26 } } } ], "source": { "type": "Literal", "value": "../util/subscribeToResult", "raw": "'../util/subscribeToResult'", "range": [ 222, 249 ], "loc": { "start": { "line": 5, "column": 34 }, "end": { "line": 5, "column": 61 } } }, "range": [ 188, 250 ], "loc": { "start": { "line": 5, "column": 0 }, "end": { "line": 5, "column": 62 } }, "trailingComments": [ { "type": "Block", "value": "*\n * Returns an Observable that emits the same values as the source observable with the exception of an `error`.\n * An `error` will cause the emission of the Throwable that cause the error to the Observable returned from\n * notificationHandler. If that Observable calls onComplete or `error` then retry will call `complete` or `error`\n * on the child subscription. Otherwise, this Observable will resubscribe to the source observable, on a particular\n * Scheduler.\n *\n * <img src=\"./img/retryWhen.png\" width=\"100%\">\n *\n * @param {notificationHandler} receives an Observable of notifications with which a user can `complete` or `error`,\n * aborting the retry.\n * @param {scheduler} the Scheduler on which to subscribe to the source Observable.\n * @return {Observable} the source Observable modified with retry logic.\n * @method retryWhen\n * @owner Observable\n ", "range": [ 251, 1114 ], "loc": { "start": { "line": 6, "column": 0 }, "end": { "line": 21, "column": 3 } } } ] }, { "type": "ExportNamedDeclaration", "declaration": { "type": "FunctionDeclaration", "id": { "type": "Identifier", "name": "retryWhen", "range": [ 1131, 1140 ], "loc": { "start": { "line": 22, "column": 16 }, "end": { "line": 22, "column": 25 } } }, "params": [ { "type": "Identifier", "name": "notifier", "range": [ 1141, 1149 ], "loc": { "start": { "line": 22, "column": 26 }, "end": { "line": 22, "column": 34 } } } ], "body": { "type": "BlockStatement", "body": [ { "type": "ReturnStatement", "argument": { "type": "CallExpression", "callee": { "type": "MemberExpression", "computed": false, "object": { "type": "ThisExpression", "range": [ 1164, 1168 ], "loc": { "start": { "line": 23, "column": 11 }, "end": { "line": 23, "column": 15 } } }, "property": { "type": "Identifier", "name": "lift", "range": [ 1169, 1173 ], "loc": { "start": { "line": 23, "column": 16 }, "end": { "line": 23, "column": 20 } } }, "range": [ 1164, 1173 ], "loc": { "start": { "line": 23, "column": 11 }, "end": { "line": 23, "column": 20 } } }, "arguments": [ { "type": "NewExpression", "callee": { "type": "Identifier", "name": "RetryWhenOperator", "range": [ 1178, 1195 ], "loc": { "start": { "line": 23, "column": 25 }, "end": { "line": 23, "column": 42 } } }, "arguments": [ { "type": "Identifier", "name": "notifier", "range": [ 1196, 1204 ], "loc": { "start": { "line": 23, "column": 43 }, "end": { "line": 23, "column": 51 } } }, { "type": "ThisExpression", "range": [ 1206, 1210 ], "loc": { "start": { "line": 23, "column": 53 }, "end": { "line": 23, "column": 57 } } } ], "range": [ 1174, 1211 ], "loc": { "start": { "line": 23, "column": 21 }, "end": { "line": 23, "column": 58 } } } ], "range": [ 1164, 1212 ], "loc": { "start": { "line": 23, "column": 11 }, "end": { "line": 23, "column": 59 } } }, "range": [ 1157, 1213 ], "loc": { "start": { "line": 23, "column": 4 }, "end": { "line": 23, "column": 60 } } } ], "range": [ 1151, 1215 ], "loc": { "start": { "line": 22, "column": 36 }, "end": { "line": 24, "column": 1 } } }, "generator": false, "expression": false, "range": [ 1122, 1215 ], "loc": { "start": { "line": 22, "column": 7 }, "end": { "line": 24, "column": 1 } }, "leadingComments": [ { "type": "Block", "value": "*\n * Returns an Observable that emits the same values as the source observable with the exception of an `error`.\n * An `error` will cause the emission of the Throwable that cause the error to the Observable returned from\n * notificationHandler. If that Observable calls onComplete or `error` then retry will call `complete` or `error`\n * on the child subscription. Otherwise, this Observable will resubscribe to the source observable, on a particular\n * Scheduler.\n *\n * <img src=\"./img/retryWhen.png\" width=\"100%\">\n *\n * @param {notificationHandler} receives an Observable of notifications with which a user can `complete` or `error`,\n * aborting the retry.\n * @param {scheduler} the Scheduler on which to subscribe to the source Observable.\n * @return {Observable} the source Observable modified with retry logic.\n * @method retryWhen\n * @owner Observable\n ", "range": [ 251, 1114 ], "loc": { "start": { "line": 6, "column": 0 }, "end": { "line": 21, "column": 3 } } } ], "trailingComments": [] }, "specifiers": [], "source": null, "range": [ 1115, 1215 ], "loc": { "start": { "line": 22, "column": 0 }, "end": { "line": 24, "column": 1 } }, "leadingComments": [ { "type": "Block", "value": "*\n * Returns an Observable that emits the same values as the source observable with the exception of an `error`.\n * An `error` will cause the emission of the Throwable that cause the error to the Observable returned from\n * notificationHandler. If that Observable calls onComplete or `error` then retry will call `complete` or `error`\n * on the child subscription. Otherwise, this Observable will resubscribe to the source observable, on a particular\n * Scheduler.\n *\n * <img src=\"./img/retryWhen.png\" width=\"100%\">\n *\n * @param {notificationHandler} receives an Observable of notifications with which a user can `complete` or `error`,\n * aborting the retry.\n * @param {scheduler} the Scheduler on which to subscribe to the source Observable.\n * @return {Observable} the source Observable modified with retry logic.\n * @method retryWhen\n * @owner Observable\n ", "range": [ 251, 1114 ], "loc": { "start": { "line": 6, "column": 0 }, "end": { "line": 21, "column": 3 } } } ] }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "RetryWhenOperator", "range": [ 1220, 1237 ], "loc": { "start": { "line": 25, "column": 4 }, "end": { "line": 25, "column": 21 } } }, "init": { "type": "CallExpression", "callee": { "type": "FunctionExpression", "id": null, "params": [], "body": { "type": "BlockStatement", "body": [ { "type": "FunctionDeclaration", "id": { "type": "Identifier", "name": "RetryWhenOperator", "range": [ 1268, 1285 ], "loc": { "start": { "line": 26, "column": 13 }, "end": { "line": 26, "column": 30 } } }, "params": [ { "type": "Identifier", "name": "notifier", "range": [ 1286, 1294 ], "loc": { "start": { "line": 26, "column": 31 }, "end": { "line": 26, "column": 39 } } }, { "type": "Identifier", "name": "source", "range": [ 1296, 1302 ], "loc": { "start": { "line": 26, "column": 41 }, "end": { "line": 26, "column": 47 } } } ], "body": { "type": "BlockStatement", "body": [ { "type": "ExpressionStatement", "expression": { "type": "AssignmentExpression", "operator": "=", "left": { "type": "MemberExpression", "computed": false, "object": { "type": "ThisExpression", "range": [ 1314, 1318 ], "loc": { "start": { "line": 27, "column": 8 }, "end": { "line": 27, "column": 12 } } }, "property": { "type": "Identifier", "name": "notifier", "range": [ 1319, 1327 ], "loc": { "start": { "line": 27, "column": 13 }, "end": { "line": 27, "column": 21 } } }, "range": [ 1314, 1327 ], "loc": { "start": { "line": 27, "column": 8 }, "end": { "line": 27, "column": 21 } } }, "right": { "type": "Identifier", "name": "notifier", "range": [ 1330, 1338 ], "loc": { "start": { "line": 27, "column": 24 }, "end": { "line": 27, "column": 32 } } }, "range": [ 1314, 1338 ], "loc": { "start": { "line": 27, "column": 8 }, "end": { "line": 27, "column": 32 } } }, "range": [ 1314, 1339 ], "loc": { "start": { "line": 27, "column": 8 }, "end": { "line": 27, "column": 33 } } }, { "type": "ExpressionStatement", "expression": { "type": "AssignmentExpression", "operator": "=", "left": { "type": "MemberExpression", "computed": false, "object": { "type": "ThisExpression", "range": [ 1348, 1352 ], "loc": { "start": { "line": 28, "column": 8 }, "end": { "line": 28, "column": 12 } } }, "property": { "type": "Identifier", "name": "source", "range": [ 1353, 1359 ], "loc": { "start": { "line": 28, "column": 13 }, "end": { "line": 28, "column": 19 } } }, "range": [ 1348, 1359 ], "loc": { "start": { "line": 28, "column": 8 }, "end": { "line": 28, "column": 19 } } }, "right": { "type": "Identifier", "name": "source", "range": [ 1362, 1368 ], "loc": { "start": { "line": 28, "column": 22 }, "end": { "line": 28, "column": 28 } } }, "range": [ 1348, 1368 ], "loc": { "start": { "line": 28, "column": 8 }, "end": { "line": 28, "column": 28 } } }, "range": [ 1348, 1369 ], "loc": { "start": { "line": 28, "column": 8 }, "end": { "line": 28, "column": 29 } } } ], "range": [ 1304, 1375 ], "loc": { "start": { "line": 26, "column": 49 }, "end": { "line": 29, "column": 5 } } }, "generator": false, "expression": false, "range": [ 1259, 1375 ], "loc": { "start": { "line": 26, "column": 4 }, "end": { "line": 29, "column": 5 } } }, { "type": "ExpressionStatement", "expression": { "type": "AssignmentExpression", "operator": "=", "left": { "type": "MemberExpression", "computed": false, "object": { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "RetryWhenOperator", "range": [ 1380, 1397 ], "loc": { "start": { "line": 30, "column": 4 }, "end": { "line": 30, "column": 21 } } }, "property": { "type": "Identifier", "name": "prototype", "range": [ 1398, 1407 ], "loc": { "start": { "line": 30, "column": 22 }, "end": { "line": 30, "column": 31 } } }, "range": [ 1380, 1407 ], "loc": { "start": { "line": 30, "column": 4 }, "end": { "line": 30, "column": 31 } } }, "property": { "type": "Identifier", "name": "call", "range": [ 1408, 1412 ], "loc": { "start": { "line": 30, "column": 32 }, "end": { "line": 30, "column": 36 } } }, "range": [ 1380, 1412 ], "loc": { "start": { "line": 30, "column": 4 }, "end": { "line": 30, "column": 36 } } }, "right": { "type": "FunctionExpression", "id": null, "params": [ { "type": "Identifier", "name": "subscriber", "range": [ 1425, 1435 ], "loc": { "start": { "line": 30, "column": 49 }, "end": { "line": 30, "column": 59 } } }, { "type": "Identifier", "name": "source", "range": [ 1437, 1443 ], "loc": { "start": { "line": 30, "column": 61 }, "end": { "line": 30, "column": 67 } } } ], "body": { "type": "BlockStatement", "body": [ { "type": "ReturnStatement", "argument": { "type": "CallExpression", "callee": { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "source", "range": [ 1462, 1468 ], "loc": { "start": { "line": 31, "column": 15 }, "end": { "line": 31, "column": 21 } } }, "property": { "type": "Identifier", "name": "_subscribe", "range": [ 1469, 1479 ], "loc": { "start": { "line": 31, "column": 22 }, "end": { "line": 31, "column": 32 } } }, "range": [ 1462, 1479 ], "loc": { "start": { "line": 31, "column": 15 }, "end": { "line": 31, "column": 32 } } }, "arguments": [ { "type": "NewExpression", "callee": { "type": "Identifier", "name": "RetryWhenSubscriber", "range": [ 1484, 1503 ], "loc": { "start": { "line": 31, "column": 37 }, "end": { "line": 31, "column": 56 } } }, "arguments": [ { "type": "Identifier", "name": "subscriber", "range": [ 1504, 1514 ], "loc": { "start": { "line": 31, "column": 57 }, "end": { "line": 31, "column": 67 } } }, { "type": "MemberExpression", "computed": false, "object": { "type": "ThisExpression", "range": [ 1516, 1520 ], "loc": { "start": { "line": 31, "column": 69 }, "end": { "line": 31, "column": 73 } } }, "property": { "type": "Identifier", "name": "notifier", "range": [ 1521, 1529 ], "loc": { "start": { "line": 31, "column": 74 }, "end": { "line": 31, "column": 82 } } }, "range": [ 1516, 1529 ], "loc": { "start": { "line": 31, "column": 69 }, "end": { "line": 31, "column": 82 } } }, { "type": "MemberExpression", "computed": false, "object": { "type": "ThisExpression", "range": [ 1531, 1535 ], "loc": { "start": { "line": 31, "column": 84 }, "end": { "line": 31, "column": 88 } } }, "property": { "type": "Identifier", "name": "source", "range": [ 1536, 1542 ], "loc": { "start": { "line": 31, "column": 89 }, "end": { "line": 31, "column": 95 } } }, "range": [ 1531, 1542 ], "loc": { "start": { "line": 31, "column": 84 }, "end": { "line": 31, "column": 95 } } } ], "range": [ 1480, 1543 ], "loc": { "start": { "line": 31, "column": 33 }, "end": { "line": 31, "column": 96 } } } ], "range": [ 1462, 1544 ], "loc": { "start": { "line": 31, "column": 15 }, "end": { "line": 31, "column": 97 } } }, "range": [ 1455, 1545 ], "loc": { "start": { "line": 31, "column": 8 }, "end": { "line": 31, "column": 98 } } } ], "range": [ 1445, 1551 ], "loc": { "start": { "line": 30, "column": 69 }, "end": { "line": 32, "column": 5 } } },