UNPKG

@reactivex/rxjs

Version:

Reactive Extensions for modern JavaScript

1,519 lines (1,518 loc) 316 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 a `complete`.\n * A `complete` will cause the emission of the Throwable that cause the complete to the Observable returned from\n * notificationHandler. If that Observable calls onComplete or `complete` 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/repeatWhen.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 repeatWhen\n * @owner Observable\n ", "range": [ 251, 1126 ], "loc": { "start": { "line": 6, "column": 0 }, "end": { "line": 21, "column": 3 } } } ] }, { "type": "ExportNamedDeclaration", "declaration": { "type": "FunctionDeclaration", "id": { "type": "Identifier", "name": "repeatWhen", "range": [ 1143, 1153 ], "loc": { "start": { "line": 22, "column": 16 }, "end": { "line": 22, "column": 26 } } }, "params": [ { "type": "Identifier", "name": "notifier", "range": [ 1154, 1162 ], "loc": { "start": { "line": 22, "column": 27 }, "end": { "line": 22, "column": 35 } } } ], "body": { "type": "BlockStatement", "body": [ { "type": "ReturnStatement", "argument": { "type": "CallExpression", "callee": { "type": "MemberExpression", "computed": false, "object": { "type": "ThisExpression", "range": [ 1177, 1181 ], "loc": { "start": { "line": 23, "column": 11 }, "end": { "line": 23, "column": 15 } } }, "property": { "type": "Identifier", "name": "lift", "range": [ 1182, 1186 ], "loc": { "start": { "line": 23, "column": 16 }, "end": { "line": 23, "column": 20 } } }, "range": [ 1177, 1186 ], "loc": { "start": { "line": 23, "column": 11 }, "end": { "line": 23, "column": 20 } } }, "arguments": [ { "type": "NewExpression", "callee": { "type": "Identifier", "name": "RepeatWhenOperator", "range": [ 1191, 1209 ], "loc": { "start": { "line": 23, "column": 25 }, "end": { "line": 23, "column": 43 } } }, "arguments": [ { "type": "Identifier", "name": "notifier", "range": [ 1210, 1218 ], "loc": { "start": { "line": 23, "column": 44 }, "end": { "line": 23, "column": 52 } } }, { "type": "ThisExpression", "range": [ 1220, 1224 ], "loc": { "start": { "line": 23, "column": 54 }, "end": { "line": 23, "column": 58 } } } ], "range": [ 1187, 1225 ], "loc": { "start": { "line": 23, "column": 21 }, "end": { "line": 23, "column": 59 } } } ], "range": [ 1177, 1226 ], "loc": { "start": { "line": 23, "column": 11 }, "end": { "line": 23, "column": 60 } } }, "range": [ 1170, 1227 ], "loc": { "start": { "line": 23, "column": 4 }, "end": { "line": 23, "column": 61 } } } ], "range": [ 1164, 1229 ], "loc": { "start": { "line": 22, "column": 37 }, "end": { "line": 24, "column": 1 } } }, "generator": false, "expression": false, "range": [ 1134, 1229 ], "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 a `complete`.\n * A `complete` will cause the emission of the Throwable that cause the complete to the Observable returned from\n * notificationHandler. If that Observable calls onComplete or `complete` 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/repeatWhen.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 repeatWhen\n * @owner Observable\n ", "range": [ 251, 1126 ], "loc": { "start": { "line": 6, "column": 0 }, "end": { "line": 21, "column": 3 } } } ], "trailingComments": [] }, "specifiers": [], "source": null, "range": [ 1127, 1229 ], "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 a `complete`.\n * A `complete` will cause the emission of the Throwable that cause the complete to the Observable returned from\n * notificationHandler. If that Observable calls onComplete or `complete` 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/repeatWhen.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 repeatWhen\n * @owner Observable\n ", "range": [ 251, 1126 ], "loc": { "start": { "line": 6, "column": 0 }, "end": { "line": 21, "column": 3 } } } ] }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "RepeatWhenOperator", "range": [ 1234, 1252 ], "loc": { "start": { "line": 25, "column": 4 }, "end": { "line": 25, "column": 22 } } }, "init": { "type": "CallExpression", "callee": { "type": "FunctionExpression", "id": null, "params": [], "body": { "type": "BlockStatement", "body": [ { "type": "FunctionDeclaration", "id": { "type": "Identifier", "name": "RepeatWhenOperator", "range": [ 1283, 1301 ], "loc": { "start": { "line": 26, "column": 13 }, "end": { "line": 26, "column": 31 } } }, "params": [ { "type": "Identifier", "name": "notifier", "range": [ 1302, 1310 ], "loc": { "start": { "line": 26, "column": 32 }, "end": { "line": 26, "column": 40 } } }, { "type": "Identifier", "name": "source", "range": [ 1312, 1318 ], "loc": { "start": { "line": 26, "column": 42 }, "end": { "line": 26, "column": 48 } } } ], "body": { "type": "BlockStatement", "body": [ { "type": "ExpressionStatement", "expression": { "type": "AssignmentExpression", "operator": "=", "left": { "type": "MemberExpression", "computed": false, "object": { "type": "ThisExpression", "range": [ 1330, 1334 ], "loc": { "start": { "line": 27, "column": 8 }, "end": { "line": 27, "column": 12 } } }, "property": { "type": "Identifier", "name": "notifier", "range": [ 1335, 1343 ], "loc": { "start": { "line": 27, "column": 13 }, "end": { "line": 27, "column": 21 } } }, "range": [ 1330, 1343 ], "loc": { "start": { "line": 27, "column": 8 }, "end": { "line": 27, "column": 21 } } }, "right": { "type": "Identifier", "name": "notifier", "range": [ 1346, 1354 ], "loc": { "start": { "line": 27, "column": 24 }, "end": { "line": 27, "column": 32 } } }, "range": [ 1330, 1354 ], "loc": { "start": { "line": 27, "column": 8 }, "end": { "line": 27, "column": 32 } } }, "range": [ 1330, 1355 ], "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": [ 1364, 1368 ], "loc": { "start": { "line": 28, "column": 8 }, "end": { "line": 28, "column": 12 } } }, "property": { "type": "Identifier", "name": "source", "range": [ 1369, 1375 ], "loc": { "start": { "line": 28, "column": 13 }, "end": { "line": 28, "column": 19 } } }, "range": [ 1364, 1375 ], "loc": { "start": { "line": 28, "column": 8 }, "end": { "line": 28, "column": 19 } } }, "right": { "type": "Identifier", "name": "source", "range": [ 1378, 1384 ], "loc": { "start": { "line": 28, "column": 22 }, "end": { "line": 28, "column": 28 } } }, "range": [ 1364, 1384 ], "loc": { "start": { "line": 28, "column": 8 }, "end": { "line": 28, "column": 28 } } }, "range": [ 1364, 1385 ], "loc": { "start": { "line": 28, "column": 8 }, "end": { "line": 28, "column": 29 } } } ], "range": [ 1320, 1391 ], "loc": { "start": { "line": 26, "column": 50 }, "end": { "line": 29, "column": 5 } } }, "generator": false, "expression": false, "range": [ 1274, 1391 ], "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": "RepeatWhenOperator", "range": [ 1396, 1414 ], "loc": { "start": { "line": 30, "column": 4 }, "end": { "line": 30, "column": 22 } } }, "property": { "type": "Identifier", "name": "prototype", "range": [ 1415, 1424 ], "loc": { "start": { "line": 30, "column": 23 }, "end": { "line": 30, "column": 32 } } }, "range": [ 1396, 1424 ], "loc": { "start": { "line": 30, "column": 4 }, "end": { "line": 30, "column": 32 } } }, "property": { "type": "Identifier", "name": "call", "range": [ 1425, 1429 ], "loc": { "start": { "line": 30, "column": 33 }, "end": { "line": 30, "column": 37 } } }, "range": [ 1396, 1429 ], "loc": { "start": { "line": 30, "column": 4 }, "end": { "line": 30, "column": 37 } } }, "right": { "type": "FunctionExpression", "id": null, "params": [ { "type": "Identifier", "name": "subscriber", "range": [ 1442, 1452 ], "loc": { "start": { "line": 30, "column": 50 }, "end": { "line": 30, "column": 60 } } }, { "type": "Identifier", "name": "source", "range": [ 1454, 1460 ], "loc": { "start": { "line": 30, "column": 62 }, "end": { "line": 30, "column": 68 } } } ], "body": { "type": "BlockStatement", "body": [ { "type": "ReturnStatement", "argument": { "type": "CallExpression", "callee": { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "source", "range": [ 1479, 1485 ], "loc": { "start": { "line": 31, "column": 15 }, "end": { "line": 31, "column": 21 } } }, "property": { "type": "Identifier", "name": "_subscribe", "range": [ 1486, 1496 ], "loc": { "start": { "line": 31, "column": 22 }, "end": { "line": 31, "column": 32 } } }, "range": [ 1479, 1496 ], "loc": { "start": { "line": 31, "column": 15 }, "end": { "line": 31, "column": 32 } } }, "arguments": [ { "type": "NewExpression", "callee": { "type": "Identifier", "name": "RepeatWhenSubscriber", "range": [ 1501, 1521 ], "loc": { "start": { "line": 31, "column": 37 }, "end": { "line": 31, "column": 57 } } }, "arguments": [ { "type": "Identifier", "name": "subscriber", "range": [ 1522, 1532 ], "loc": { "start": { "line": 31, "column": 58 }, "end": { "line": 31, "column": 68 } } }, { "type": "MemberExpression", "computed": false, "object": { "type": "ThisExpression", "range": [ 1534, 1538 ], "loc": { "start": { "line": 31, "column": 70 }, "end": { "line": 31, "column": 74 } } }, "property": { "type": "Identifier", "name": "notifier", "range": [ 1539, 1547 ], "loc": { "start": { "line": 31, "column": 75 }, "end": { "line": 31, "column": 83 } } }, "range": [ 1534, 1547 ], "loc": { "start": { "line": 31, "column": 70 }, "end": { "line": 31, "column": 83 } } }, { "type": "MemberExpression", "computed": false, "object": { "type": "ThisExpression", "range": [ 1549, 1553 ], "loc": { "start": { "line": 31, "column": 85 }, "end": { "line": 31, "column": 89 } } }, "property": { "type": "Identifier", "name": "source", "range": [ 1554, 1560 ], "loc": { "start": { "line": 31, "column": 90 }, "end": { "line": 31, "column": 96 } } }, "range": [ 1549, 1560 ], "loc": { "start": { "line": 31, "column": 85 }, "end": { "line": 31, "column": 96 } } } ], "range": [ 1497, 1561 ], "loc": { "start": { "line": 31, "column": 33 }, "end": { "line": 31, "column": 97 } } } ], "range": [ 1479, 1562 ], "loc": { "start": { "line": 31, "column": 15 }, "end": { "line": 31, "column": 98 } } }, "range": [ 1472, 1563 ], "loc": { "start": { "line": 31, "column": 8 }, "end": { "line": 31, "column": 99 } } } ], "range": [ 1462, 1569 ], "loc": { "start": { "line": 30, "column": 70 }, "end": { "line": 32, "column": 5 } }