UNPKG

@reactivex/rxjs

Version:

Reactive Extensions for modern JavaScript

1,768 lines (1,767 loc) 354 kB
{ "type": "Program", "body": [ { "type": "ImportDeclaration", "specifiers": [ { "type": "ImportSpecifier", "local": { "type": "Identifier", "name": "ArrayObservable", "range": [ 9, 24 ], "loc": { "start": { "line": 1, "column": 9 }, "end": { "line": 1, "column": 24 } } }, "imported": { "type": "Identifier", "name": "ArrayObservable", "range": [ 9, 24 ], "loc": { "start": { "line": 1, "column": 9 }, "end": { "line": 1, "column": 24 } } }, "range": [ 9, 24 ], "loc": { "start": { "line": 1, "column": 9 }, "end": { "line": 1, "column": 24 } } } ], "source": { "type": "Literal", "value": "../observable/ArrayObservable", "raw": "'../observable/ArrayObservable'", "range": [ 32, 63 ], "loc": { "start": { "line": 1, "column": 32 }, "end": { "line": 1, "column": 63 } } }, "range": [ 0, 64 ], "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 1, "column": 64 } } }, { "type": "ImportDeclaration", "specifiers": [ { "type": "ImportSpecifier", "local": { "type": "Identifier", "name": "isArray", "range": [ 74, 81 ], "loc": { "start": { "line": 2, "column": 9 }, "end": { "line": 2, "column": 16 } } }, "imported": { "type": "Identifier", "name": "isArray", "range": [ 74, 81 ], "loc": { "start": { "line": 2, "column": 9 }, "end": { "line": 2, "column": 16 } } }, "range": [ 74, 81 ], "loc": { "start": { "line": 2, "column": 9 }, "end": { "line": 2, "column": 16 } } } ], "source": { "type": "Literal", "value": "../util/isArray", "raw": "'../util/isArray'", "range": [ 89, 106 ], "loc": { "start": { "line": 2, "column": 24 }, "end": { "line": 2, "column": 41 } } }, "range": [ 65, 107 ], "loc": { "start": { "line": 2, "column": 0 }, "end": { "line": 2, "column": 42 } } }, { "type": "ImportDeclaration", "specifiers": [ { "type": "ImportSpecifier", "local": { "type": "Identifier", "name": "OuterSubscriber", "range": [ 117, 132 ], "loc": { "start": { "line": 3, "column": 9 }, "end": { "line": 3, "column": 24 } } }, "imported": { "type": "Identifier", "name": "OuterSubscriber", "range": [ 117, 132 ], "loc": { "start": { "line": 3, "column": 9 }, "end": { "line": 3, "column": 24 } } }, "range": [ 117, 132 ], "loc": { "start": { "line": 3, "column": 9 }, "end": { "line": 3, "column": 24 } } } ], "source": { "type": "Literal", "value": "../OuterSubscriber", "raw": "'../OuterSubscriber'", "range": [ 140, 160 ], "loc": { "start": { "line": 3, "column": 32 }, "end": { "line": 3, "column": 52 } } }, "range": [ 108, 161 ], "loc": { "start": { "line": 3, "column": 0 }, "end": { "line": 3, "column": 53 } } }, { "type": "ImportDeclaration", "specifiers": [ { "type": "ImportSpecifier", "local": { "type": "Identifier", "name": "subscribeToResult", "range": [ 171, 188 ], "loc": { "start": { "line": 4, "column": 9 }, "end": { "line": 4, "column": 26 } } }, "imported": { "type": "Identifier", "name": "subscribeToResult", "range": [ 171, 188 ], "loc": { "start": { "line": 4, "column": 9 }, "end": { "line": 4, "column": 26 } } }, "range": [ 171, 188 ], "loc": { "start": { "line": 4, "column": 9 }, "end": { "line": 4, "column": 26 } } } ], "source": { "type": "Literal", "value": "../util/subscribeToResult", "raw": "'../util/subscribeToResult'", "range": [ 196, 223 ], "loc": { "start": { "line": 4, "column": 34 }, "end": { "line": 4, "column": 61 } } }, "range": [ 162, 224 ], "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 4, "column": 62 } } }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "none", "range": [ 229, 233 ], "loc": { "start": { "line": 5, "column": 4 }, "end": { "line": 5, "column": 8 } } }, "init": { "type": "ObjectExpression", "properties": [], "range": [ 236, 238 ], "loc": { "start": { "line": 5, "column": 11 }, "end": { "line": 5, "column": 13 } } }, "range": [ 229, 238 ], "loc": { "start": { "line": 5, "column": 4 }, "end": { "line": 5, "column": 13 } } } ], "kind": "var", "range": [ 225, 239 ], "loc": { "start": { "line": 5, "column": 0 }, "end": { "line": 5, "column": 14 } }, "trailingComments": [ { "type": "Block", "value": " tslint:disable:max-line-length ", "range": [ 240, 276 ], "loc": { "start": { "line": 6, "column": 0 }, "end": { "line": 6, "column": 36 } } } ] }, { "type": "ExportNamedDeclaration", "declaration": { "type": "FunctionDeclaration", "id": { "type": "Identifier", "name": "combineLatest", "range": [ 293, 306 ], "loc": { "start": { "line": 7, "column": 16 }, "end": { "line": 7, "column": 29 } } }, "params": [], "body": { "type": "BlockStatement", "body": [ { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "observables", "range": [ 319, 330 ], "loc": { "start": { "line": 8, "column": 8 }, "end": { "line": 8, "column": 19 } } }, "init": { "type": "ArrayExpression", "elements": [], "range": [ 333, 335 ], "loc": { "start": { "line": 8, "column": 22 }, "end": { "line": 8, "column": 24 } } }, "range": [ 319, 335 ], "loc": { "start": { "line": 8, "column": 8 }, "end": { "line": 8, "column": 24 } } } ], "kind": "var", "range": [ 315, 336 ], "loc": { "start": { "line": 8, "column": 4 }, "end": { "line": 8, "column": 25 } } }, { "type": "ForStatement", "init": { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "_i", "range": [ 350, 352 ], "loc": { "start": { "line": 9, "column": 13 }, "end": { "line": 9, "column": 15 } } }, "init": { "type": "Literal", "value": 0, "raw": "0", "range": [ 355, 356 ], "loc": { "start": { "line": 9, "column": 18 }, "end": { "line": 9, "column": 19 } } }, "range": [ 350, 356 ], "loc": { "start": { "line": 9, "column": 13 }, "end": { "line": 9, "column": 19 } } } ], "kind": "var", "range": [ 346, 356 ], "loc": { "start": { "line": 9, "column": 9 }, "end": { "line": 9, "column": 19 } } }, "test": { "type": "BinaryExpression", "operator": "<", "left": { "type": "Identifier", "name": "_i", "range": [ 358, 360 ], "loc": { "start": { "line": 9, "column": 21 }, "end": { "line": 9, "column": 23 } } }, "right": { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "arguments", "range": [ 363, 372 ], "loc": { "start": { "line": 9, "column": 26 }, "end": { "line": 9, "column": 35 } } }, "property": { "type": "Identifier", "name": "length", "range": [ 373, 379 ], "loc": { "start": { "line": 9, "column": 36 }, "end": { "line": 9, "column": 42 } } }, "range": [ 363, 379 ], "loc": { "start": { "line": 9, "column": 26 }, "end": { "line": 9, "column": 42 } } }, "range": [ 358, 379 ], "loc": { "start": { "line": 9, "column": 21 }, "end": { "line": 9, "column": 42 } } }, "update": { "type": "UpdateExpression", "operator": "++", "argument": { "type": "Identifier", "name": "_i", "range": [ 381, 383 ], "loc": { "start": { "line": 9, "column": 44 }, "end": { "line": 9, "column": 46 } } }, "prefix": false, "range": [ 381, 385 ], "loc": { "start": { "line": 9, "column": 44 }, "end": { "line": 9, "column": 48 } } }, "body": { "type": "BlockStatement", "body": [ { "type": "ExpressionStatement", "expression": { "type": "AssignmentExpression", "operator": "=", "left": { "type": "MemberExpression", "computed": true, "object": { "type": "Identifier", "name": "observables", "range": [ 397, 408 ], "loc": { "start": { "line": 10, "column": 8 }, "end": { "line": 10, "column": 19 } } }, "property": { "type": "BinaryExpression", "operator": "-", "left": { "type": "Identifier", "name": "_i", "range": [ 409, 411 ], "loc": { "start": { "line": 10, "column": 20 }, "end": { "line": 10, "column": 22 } } }, "right": { "type": "Literal", "value": 0, "raw": "0", "range": [ 414, 415 ], "loc": { "start": { "line": 10, "column": 25 }, "end": { "line": 10, "column": 26 } } }, "range": [ 409, 415 ], "loc": { "start": { "line": 10, "column": 20 }, "end": { "line": 10, "column": 26 } } }, "range": [ 397, 416 ], "loc": { "start": { "line": 10, "column": 8 }, "end": { "line": 10, "column": 27 } } }, "right": { "type": "MemberExpression", "computed": true, "object": { "type": "Identifier", "name": "arguments", "range": [ 419, 428 ], "loc": { "start": { "line": 10, "column": 30 }, "end": { "line": 10, "column": 39 } } }, "property": { "type": "Identifier", "name": "_i", "range": [ 429, 431 ], "loc": { "start": { "line": 10, "column": 40 }, "end": { "line": 10, "column": 42 } } }, "range": [ 419, 432 ], "loc": { "start": { "line": 10, "column": 30 }, "end": { "line": 10, "column": 43 } } }, "range": [ 397, 432 ], "loc": { "start": { "line": 10, "column": 8 }, "end": { "line": 10, "column": 43 } } }, "range": [ 397, 433 ], "loc": { "start": { "line": 10, "column": 8 }, "end": { "line": 10, "column": 44 } } } ], "range": [ 387, 439 ], "loc": { "start": { "line": 9, "column": 50 }, "end": { "line": 11, "column": 5 } } }, "range": [ 341, 439 ], "loc": { "start": { "line": 9, "column": 4 }, "end": { "line": 11, "column": 5 } } }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "project", "range": [ 448, 455 ], "loc": { "start": { "line": 12, "column": 8 }, "end": { "line": 12, "column": 15 } } }, "init": { "type": "Literal", "value": null, "raw": "null", "range": [ 458, 462 ], "loc": { "start": { "line": 12, "column": 18 }, "end": { "line": 12, "column": 22 } } }, "range": [ 448, 462 ], "loc": { "start": { "line": 12, "column": 8 }, "end": { "line": 12, "column": 22 } } } ], "kind": "var", "range": [ 444, 463 ], "loc": { "start": { "line": 12, "column": 4 }, "end": { "line": 12, "column": 23 } } }, { "type": "IfStatement", "test": { "type": "BinaryExpression", "operator": "===", "left": { "type": "UnaryExpression", "operator": "typeof", "argument": { "type": "MemberExpression", "computed": true, "object": { "type": "Identifier", "name": "observables", "range": [ 479, 490 ], "loc": { "start": { "line": 13, "column": 15 }, "end": { "line": 13, "column": 26 } } }, "property": { "type": "BinaryExpression", "operator": "-", "left": { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "observables", "range": [ 491, 502 ], "loc": { "start": { "line": 13, "column": 27 }, "end": { "line": 13, "column": 38 } } }, "property": { "type": "Identifier", "name": "length", "range": [ 503, 509 ], "loc": { "start": { "line": 13, "column": 39 }, "end": { "line": 13, "column": 45 } } }, "range": [ 491, 509 ], "loc": { "start": { "line": 13, "column": 27 }, "end": { "line": 13, "column": 45 } } }, "right": { "type": "Literal", "value": 1, "raw": "1", "range": [ 512, 513 ], "loc": { "start": { "line": 13, "column": 48 }, "end": { "line": 13, "column": 49 } } }, "range": [ 491, 513 ], "loc": { "start": { "line": 13, "column": 27 }, "end": { "line": 13, "column": 49 } } }, "range": [ 479, 514 ], "loc": { "start": { "line": 13, "column": 15 }, "end": { "line": 13, "column": 50 } } }, "prefix": true, "range": [ 472, 514 ], "loc": { "start": { "line": 13, "column": 8 }, "end": { "line": 13, "column": 50 } } }, "right": { "type": "Literal", "value": "function", "raw": "'function'", "range": [ 519, 529 ], "loc": { "start": { "line": 13, "column": 55 }, "end": { "line": 13, "column": 65 } } }, "range": [ 472, 529 ], "loc": { "start": { "line": 13, "column": 8 }, "end": { "line": 13, "column": 65 } } }, "consequent": { "type": "BlockStatement", "body": [ { "type": "ExpressionStatement", "expression": { "type": "AssignmentExpression", "operator": "=", "left": { "type": "Identifier", "name": "project", "range": [ 541, 548 ], "loc": { "start": { "line": 14, "column": 8 }, "end": { "line": 14, "column": 15 } } }, "right": { "type": "CallExpression", "callee": { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "observables", "range": [ 551, 562 ], "loc": { "start": { "line": 14, "column": 18 }, "end": { "line": 14, "column": 29 } } }, "property": { "type": "Identifier", "name": "pop", "range": [ 563, 566 ], "loc": { "start": { "line": 14, "column": 30 }, "end": { "line": 14, "column": 33 } } }, "range": [ 551, 566 ], "loc": { "start": { "line": 14, "column": 18 }, "end": { "line": 14, "column": 33 } } }, "arguments": [], "range": [ 551, 568 ], "loc": { "start": { "line": 14, "column": 18 }, "end": { "line": 14, "column": 35 } } }, "range": [ 541, 568 ], "loc": { "start": { "line": 14, "column": 8 }, "end": { "line": 14, "column": 35 } } }, "range": [ 541, 569 ], "loc": { "start": { "line": 14, "column": 8 }, "end": { "line": 14, "column": 36 } } } ], "range": [ 531, 575 ], "loc": { "start": { "line": 13, "column": 67 }, "end": { "line": 15, "column": 5 } } }, "alternate": null, "range": [ 468, 575 ], "loc": { "start": { "line": 13, "column": 4 }, "end": { "line": 15, "column": 5 } }, "trailingComments": [ { "type": "Line", "value": " if the first and only other argument besides the resultSelector is an array", "range": [ 580, 658 ], "loc": { "start": { "line": 16, "column": 4 }, "end": { "line": 16, "column": 82 } } }, { "type": "Line", "value": " assume it's been called with `combineLatest([obs1, obs2, obs3], project)`", "range": [ 663, 739 ], "loc": { "start": { "line": 17, "column": 4 }, "end": { "line": 17, "column": 80 } } } ] }, { "type": "IfStatement", "test": { "type": "LogicalExpression", "operator": "&&", "left": { "type": "BinaryExpression", "operator": "===", "left": { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "observables", "range": [ 748, 759 ], "loc": { "start": { "line": 18, "column": 8 }, "end": { "line": 18, "column": 19 } } }, "property": { "type": "Identifier", "name": "length", "range": [ 760, 766 ], "loc": { "start": { "line": 18, "column": 20 }, "end": { "line": 18, "column": 26 } } }, "range": [ 748, 766 ], "loc": { "start": { "line": 18, "column": 8 }, "end": { "line": 18, "column": 26 } } }, "right": { "type": "Literal", "value": 1, "raw": "1", "range": [ 771, 772 ], "loc": { "start": { "line": 18, "column": 31 }, "end": { "line": 18, "column": 32 } } }, "range": [ 748, 772 ], "loc": { "start": { "line": 18, "column": 8 }, "end": { "line": 18, "column": 32 } } }, "right": { "type": "CallExpression", "callee": { "type": "Identifier", "name": "isArray", "range": [ 776, 783 ], "loc": { "start": { "line": 18, "column": 36 }, "end": { "line": 18, "column": 43 } } }, "arguments": [ { "type": "MemberExpression", "computed": true, "object": { "type": "Identifier", "name": "observables", "range": [ 784, 795 ], "loc": { "start": { "line": 18, "column": 44 }, "end": { "line": 18, "column": 55 } } }, "property": { "type": "Literal", "value": 0, "raw": "0", "range": [ 796, 797 ], "loc": { "start": { "line": 18, "column": 56 }, "end": { "line": 18, "column": 57 } } }, "range": [ 784, 798 ], "loc": { "start": { "line": 18, "column": 44 }, "end": { "line": 18, "column": 58 } } } ], "range": [ 776, 799 ], "loc": { "start": { "line": 18, "column": 36 }, "end": { "line": 18, "column": 59 } } }, "range": [ 748, 799 ], "loc": { "start": { "line": 18, "column": 8 }, "end": { "line": 18, "column": 59 } } }, "consequent": { "type": "BlockStatement", "body": [ { "type": "ExpressionStatement", "expression": { "type": "AssignmentExpression", "operator": "=", "left": { "type": "Identifier", "name": "observables", "range": [ 811, 822 ], "loc": { "start": { "line": 19, "column": 8 }, "end": { "line": 19, "column": 19 } } }, "right": { "type": "MemberExpression", "computed": true, "object": { "type": "Identifier", "name": "observables", "range": [ 825, 836 ], "loc": { "start": { "line": 19, "column": 22 }, "end": { "line": 19, "column": 33 } } }, "property": { "type": "Literal", "value": 0, "raw": "0", "range": [ 837, 838 ], "loc": { "start": { "line": 19, "column": 34 }, "end": { "line": 19, "column": 35 } } }, "range": [ 825, 839 ], "loc": { "start": { "line": 19, "column": 22 }, "end": { "line": 19, "column": 36 } } }, "range": [ 811, 839 ], "loc": { "start": { "line": 19, "column": 8 }, "end": { "line": 19, "column": 36 } } }, "range": [ 811, 840 ], "loc": { "start": { "line": 19, "column": 8 }, "end": { "line": 19, "column": 37 } } } ], "range": [ 801, 846 ], "loc": { "start": { "line": 18, "column": 61 }, "end": { "line": 20, "column": 5 } } }, "alternate": null, "range": [ 744, 846