UNPKG

@reactivex/rxjs

Version:

Reactive Extensions for modern JavaScript

1,188 lines (1,187 loc) 264 kB
{ "type": "Program", "body": [ { "type": "ImportDeclaration", "specifiers": [ { "type": "ImportSpecifier", "local": { "type": "Identifier", "name": "Observable", "range": [ 9, 19 ], "loc": { "start": { "line": 1, "column": 9 }, "end": { "line": 1, "column": 19 } } }, "imported": { "type": "Identifier", "name": "Observable", "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": "./Observable", "raw": "'./Observable'", "range": [ 27, 41 ], "loc": { "start": { "line": 1, "column": 27 }, "end": { "line": 1, "column": 41 } } }, "range": [ 0, 42 ], "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 1, "column": 42 } }, "trailingComments": [ { "type": "Block", "value": "*\n * Represents a push-based event or value that an {@link Observable} can emit.\n * This class is particularly useful for operators that manage notifications,\n * like {@link materialize}, {@link dematerialize}, {@link observeOn}, and\n * others. Besides wrapping the actual delivered value, it also annotates it\n * with metadata of, for instance, what type of push message it is (`next`,\n * `error`, or `complete`).\n *\n * @see {@link materialize}\n * @see {@link dematerialize}\n * @see {@link observeOn}\n *\n * @class Notification<T>\n ", "range": [ 43, 579 ], "loc": { "start": { "line": 2, "column": 0 }, "end": { "line": 15, "column": 3 } } } ] }, { "type": "ExportNamedDeclaration", "declaration": { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "Notification", "range": [ 591, 603 ], "loc": { "start": { "line": 16, "column": 11 }, "end": { "line": 16, "column": 23 } } }, "init": { "type": "CallExpression", "callee": { "type": "FunctionExpression", "id": null, "params": [], "body": { "type": "BlockStatement", "body": [ { "type": "FunctionDeclaration", "id": { "type": "Identifier", "name": "Notification", "range": [ 634, 646 ], "loc": { "start": { "line": 17, "column": 13 }, "end": { "line": 17, "column": 25 } } }, "params": [ { "type": "Identifier", "name": "kind", "range": [ 647, 651 ], "loc": { "start": { "line": 17, "column": 26 }, "end": { "line": 17, "column": 30 } } }, { "type": "Identifier", "name": "value", "range": [ 653, 658 ], "loc": { "start": { "line": 17, "column": 32 }, "end": { "line": 17, "column": 37 } } }, { "type": "Identifier", "name": "error", "range": [ 660, 665 ], "loc": { "start": { "line": 17, "column": 39 }, "end": { "line": 17, "column": 44 } } } ], "body": { "type": "BlockStatement", "body": [ { "type": "ExpressionStatement", "expression": { "type": "AssignmentExpression", "operator": "=", "left": { "type": "MemberExpression", "computed": false, "object": { "type": "ThisExpression", "range": [ 677, 681 ], "loc": { "start": { "line": 18, "column": 8 }, "end": { "line": 18, "column": 12 } } }, "property": { "type": "Identifier", "name": "kind", "range": [ 682, 686 ], "loc": { "start": { "line": 18, "column": 13 }, "end": { "line": 18, "column": 17 } } }, "range": [ 677, 686 ], "loc": { "start": { "line": 18, "column": 8 }, "end": { "line": 18, "column": 17 } } }, "right": { "type": "Identifier", "name": "kind", "range": [ 689, 693 ], "loc": { "start": { "line": 18, "column": 20 }, "end": { "line": 18, "column": 24 } } }, "range": [ 677, 693 ], "loc": { "start": { "line": 18, "column": 8 }, "end": { "line": 18, "column": 24 } } }, "range": [ 677, 694 ], "loc": { "start": { "line": 18, "column": 8 }, "end": { "line": 18, "column": 25 } } }, { "type": "ExpressionStatement", "expression": { "type": "AssignmentExpression", "operator": "=", "left": { "type": "MemberExpression", "computed": false, "object": { "type": "ThisExpression", "range": [ 703, 707 ], "loc": { "start": { "line": 19, "column": 8 }, "end": { "line": 19, "column": 12 } } }, "property": { "type": "Identifier", "name": "value", "range": [ 708, 713 ], "loc": { "start": { "line": 19, "column": 13 }, "end": { "line": 19, "column": 18 } } }, "range": [ 703, 713 ], "loc": { "start": { "line": 19, "column": 8 }, "end": { "line": 19, "column": 18 } } }, "right": { "type": "Identifier", "name": "value", "range": [ 716, 721 ], "loc": { "start": { "line": 19, "column": 21 }, "end": { "line": 19, "column": 26 } } }, "range": [ 703, 721 ], "loc": { "start": { "line": 19, "column": 8 }, "end": { "line": 19, "column": 26 } } }, "range": [ 703, 722 ], "loc": { "start": { "line": 19, "column": 8 }, "end": { "line": 19, "column": 27 } } }, { "type": "ExpressionStatement", "expression": { "type": "AssignmentExpression", "operator": "=", "left": { "type": "MemberExpression", "computed": false, "object": { "type": "ThisExpression", "range": [ 731, 735 ], "loc": { "start": { "line": 20, "column": 8 }, "end": { "line": 20, "column": 12 } } }, "property": { "type": "Identifier", "name": "error", "range": [ 736, 741 ], "loc": { "start": { "line": 20, "column": 13 }, "end": { "line": 20, "column": 18 } } }, "range": [ 731, 741 ], "loc": { "start": { "line": 20, "column": 8 }, "end": { "line": 20, "column": 18 } } }, "right": { "type": "Identifier", "name": "error", "range": [ 744, 749 ], "loc": { "start": { "line": 20, "column": 21 }, "end": { "line": 20, "column": 26 } } }, "range": [ 731, 749 ], "loc": { "start": { "line": 20, "column": 8 }, "end": { "line": 20, "column": 26 } } }, "range": [ 731, 750 ], "loc": { "start": { "line": 20, "column": 8 }, "end": { "line": 20, "column": 27 } } }, { "type": "ExpressionStatement", "expression": { "type": "AssignmentExpression", "operator": "=", "left": { "type": "MemberExpression", "computed": false, "object": { "type": "ThisExpression", "range": [ 759, 763 ], "loc": { "start": { "line": 21, "column": 8 }, "end": { "line": 21, "column": 12 } } }, "property": { "type": "Identifier", "name": "hasValue", "range": [ 764, 772 ], "loc": { "start": { "line": 21, "column": 13 }, "end": { "line": 21, "column": 21 } } }, "range": [ 759, 772 ], "loc": { "start": { "line": 21, "column": 8 }, "end": { "line": 21, "column": 21 } } }, "right": { "type": "BinaryExpression", "operator": "===", "left": { "type": "Identifier", "name": "kind", "range": [ 775, 779 ], "loc": { "start": { "line": 21, "column": 24 }, "end": { "line": 21, "column": 28 } } }, "right": { "type": "Literal", "value": "N", "raw": "'N'", "range": [ 784, 787 ], "loc": { "start": { "line": 21, "column": 33 }, "end": { "line": 21, "column": 36 } } }, "range": [ 775, 787 ], "loc": { "start": { "line": 21, "column": 24 }, "end": { "line": 21, "column": 36 } } }, "range": [ 759, 787 ], "loc": { "start": { "line": 21, "column": 8 }, "end": { "line": 21, "column": 36 } } }, "range": [ 759, 788 ], "loc": { "start": { "line": 21, "column": 8 }, "end": { "line": 21, "column": 37 } } } ], "range": [ 667, 794 ], "loc": { "start": { "line": 17, "column": 46 }, "end": { "line": 22, "column": 5 } } }, "generator": false, "expression": false, "range": [ 625, 794 ], "loc": { "start": { "line": 17, "column": 4 }, "end": { "line": 22, "column": 5 } }, "trailingComments": [ { "type": "Block", "value": "*\n * Delivers to the given `observer` the value wrapped by this Notification.\n * @param {Observer} observer\n * @return\n ", "range": [ 799, 939 ], "loc": { "start": { "line": 23, "column": 4 }, "end": { "line": 27, "column": 7 } } } ] }, { "type": "ExpressionStatement", "expression": { "type": "AssignmentExpression", "operator": "=", "left": { "type": "MemberExpression", "computed": false, "object": { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "Notification", "range": [ 944, 956 ], "loc": { "start": { "line": 28, "column": 4 }, "end": { "line": 28, "column": 16 } } }, "property": { "type": "Identifier", "name": "prototype", "range": [ 957, 966 ], "loc": { "start": { "line": 28, "column": 17 }, "end": { "line": 28, "column": 26 } } }, "range": [ 944, 966 ], "loc": { "start": { "line": 28, "column": 4 }, "end": { "line": 28, "column": 26 } } }, "property": { "type": "Identifier", "name": "observe", "range": [ 967, 974 ], "loc": { "start": { "line": 28, "column": 27 }, "end": { "line": 28, "column": 34 } } }, "range": [ 944, 974 ], "loc": { "start": { "line": 28, "column": 4 }, "end": { "line": 28, "column": 34 } } }, "right": { "type": "FunctionExpression", "id": null, "params": [ { "type": "Identifier", "name": "observer", "range": [ 987, 995 ], "loc": { "start": { "line": 28, "column": 47 }, "end": { "line": 28, "column": 55 } } } ], "body": { "type": "BlockStatement", "body": [ { "type": "SwitchStatement", "discriminant": { "type": "MemberExpression", "computed": false, "object": { "type": "ThisExpression", "range": [ 1015, 1019 ], "loc": { "start": { "line": 29, "column": 16 }, "end": { "line": 29, "column": 20 } } }, "property": { "type": "Identifier", "name": "kind", "range": [ 1020, 1024 ], "loc": { "start": { "line": 29, "column": 21 }, "end": { "line": 29, "column": 25 } } }, "range": [ 1015, 1024 ], "loc": { "start": { "line": 29, "column": 16 }, "end": { "line": 29, "column": 25 } } }, "cases": [ { "type": "SwitchCase", "test": { "type": "Literal", "value": "N", "raw": "'N'", "range": [ 1045, 1048 ], "loc": { "start": { "line": 30, "column": 17 }, "end": { "line": 30, "column": 20 } } }, "consequent": [ { "type": "ReturnStatement", "argument": { "type": "LogicalExpression", "operator": "&&", "left": { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "observer", "range": [ 1073, 1081 ], "loc": { "start": { "line": 31, "column": 23 }, "end": { "line": 31, "column": 31 } } }, "property": { "type": "Identifier", "name": "next", "range": [ 1082, 1086 ], "loc": { "start": { "line": 31, "column": 32 }, "end": { "line": 31, "column": 36 } } }, "range": [ 1073, 1086 ], "loc": { "start": { "line": 31, "column": 23 }, "end": { "line": 31, "column": 36 } } }, "right": { "type": "CallExpression", "callee": { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "observer", "range": [ 1090, 1098 ], "loc": { "start": { "line": 31, "column": 40 }, "end": { "line": 31, "column": 48 } } }, "property": { "type": "Identifier", "name": "next", "range": [ 1099, 1103 ], "loc": { "start": { "line": 31, "column": 49 }, "end": { "line": 31, "column": 53 } } }, "range": [ 1090, 1103 ], "loc": { "start": { "line": 31, "column": 40 }, "end": { "line": 31, "column": 53 } } }, "arguments": [ { "type": "MemberExpression", "computed": false, "object": { "type": "ThisExpression", "range": [ 1104, 1108 ], "loc": { "start": { "line": 31, "column": 54 }, "end": { "line": 31, "column": 58 } } }, "property": { "type": "Identifier", "name": "value", "range": [ 1109, 1114 ], "loc": { "start": { "line": 31, "column": 59 }, "end": { "line": 31, "column": 64 } } }, "range": [ 1104, 1114 ], "loc": { "start": { "line": 31, "column": 54 }, "end": { "line": 31, "column": 64 } } } ], "range": [ 1090, 1115 ], "loc": { "start": { "line": 31, "column": 40 }, "end": { "line": 31, "column": 65 } } }, "range": [ 1073, 1115 ], "loc": { "start": { "line": 31, "column": 23 }, "end": { "line": 31, "column": 65 } } }, "range": [ 1066, 1116 ], "loc": { "start": { "line": 31, "column": 16 }, "end": { "line": 31, "column": 66 } } } ], "range": [ 1040, 1116 ], "loc": { "start": { "line": 30, "column": 12 }, "end": { "line": 31, "column": 66 } } }, { "type": "SwitchCase", "test": { "type": "Literal", "value": "E", "raw": "'E'", "range": [ 1134, 1137 ], "loc": { "start": { "line": 32, "column": 17 }, "end": {