UNPKG

@reactivex/rxjs

Version:

Reactive Extensions for modern JavaScript

1,422 lines (1,421 loc) 677 kB
{ "type": "Program", "body": [ { "type": "ExpressionStatement", "expression": { "type": "Literal", "value": "use strict", "raw": "\"use strict\"", "range": [ 0, 12 ], "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 1, "column": 12 } } }, "range": [ 0, 13 ], "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 1, "column": 13 } } }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "Rx", "range": [ 18, 20 ], "loc": { "start": { "line": 2, "column": 4 }, "end": { "line": 2, "column": 6 } } }, "init": { "type": "CallExpression", "callee": { "type": "Identifier", "name": "require", "range": [ 23, 30 ], "loc": { "start": { "line": 2, "column": 9 }, "end": { "line": 2, "column": 16 } } }, "arguments": [ { "type": "Literal", "value": "../../dist/cjs/Rx", "raw": "'../../dist/cjs/Rx'", "range": [ 31, 50 ], "loc": { "start": { "line": 2, "column": 17 }, "end": { "line": 2, "column": 36 } } } ], "range": [ 23, 51 ], "loc": { "start": { "line": 2, "column": 9 }, "end": { "line": 2, "column": 37 } } }, "range": [ 18, 51 ], "loc": { "start": { "line": 2, "column": 4 }, "end": { "line": 2, "column": 37 } } } ], "kind": "var", "range": [ 14, 52 ], "loc": { "start": { "line": 2, "column": 0 }, "end": { "line": 2, "column": 38 } } }, { "type": "ExpressionStatement", "expression": { "type": "CallExpression", "callee": { "type": "Identifier", "name": "require", "range": [ 53, 60 ], "loc": { "start": { "line": 3, "column": 0 }, "end": { "line": 3, "column": 7 } } }, "arguments": [ { "type": "Literal", "value": "../../dist/cjs/add/observable/generate", "raw": "'../../dist/cjs/add/observable/generate'", "range": [ 61, 101 ], "loc": { "start": { "line": 3, "column": 8 }, "end": { "line": 3, "column": 48 } } } ], "range": [ 53, 102 ], "loc": { "start": { "line": 3, "column": 0 }, "end": { "line": 3, "column": 49 } } }, "range": [ 53, 103 ], "loc": { "start": { "line": 3, "column": 0 }, "end": { "line": 3, "column": 50 } } }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "chai_1", "range": [ 108, 114 ], "loc": { "start": { "line": 4, "column": 4 }, "end": { "line": 4, "column": 10 } } }, "init": { "type": "CallExpression", "callee": { "type": "Identifier", "name": "require", "range": [ 117, 124 ], "loc": { "start": { "line": 4, "column": 13 }, "end": { "line": 4, "column": 20 } } }, "arguments": [ { "type": "Literal", "value": "chai", "raw": "'chai'", "range": [ 125, 131 ], "loc": { "start": { "line": 4, "column": 21 }, "end": { "line": 4, "column": 27 } } } ], "range": [ 117, 132 ], "loc": { "start": { "line": 4, "column": 13 }, "end": { "line": 4, "column": 28 } } }, "range": [ 108, 132 ], "loc": { "start": { "line": 4, "column": 4 }, "end": { "line": 4, "column": 28 } } } ], "kind": "var", "range": [ 104, 133 ], "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 4, "column": 29 } } }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "Observable", "range": [ 138, 148 ], "loc": { "start": { "line": 5, "column": 4 }, "end": { "line": 5, "column": 14 } } }, "init": { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "Rx", "range": [ 151, 153 ], "loc": { "start": { "line": 5, "column": 17 }, "end": { "line": 5, "column": 19 } } }, "property": { "type": "Identifier", "name": "Observable", "range": [ 154, 164 ], "loc": { "start": { "line": 5, "column": 20 }, "end": { "line": 5, "column": 30 } } }, "range": [ 151, 164 ], "loc": { "start": { "line": 5, "column": 17 }, "end": { "line": 5, "column": 30 } } }, "range": [ 138, 164 ], "loc": { "start": { "line": 5, "column": 4 }, "end": { "line": 5, "column": 30 } } } ], "kind": "var", "range": [ 134, 165 ], "loc": { "start": { "line": 5, "column": 0 }, "end": { "line": 5, "column": 31 } } }, { "type": "FunctionDeclaration", "id": { "type": "Identifier", "name": "err", "range": [ 175, 178 ], "loc": { "start": { "line": 6, "column": 9 }, "end": { "line": 6, "column": 12 } } }, "params": [], "body": { "type": "BlockStatement", "body": [ { "type": "ThrowStatement", "argument": { "type": "Literal", "value": "error", "raw": "'error'", "range": [ 193, 200 ], "loc": { "start": { "line": 7, "column": 10 }, "end": { "line": 7, "column": 17 } } }, "range": [ 187, 201 ], "loc": { "start": { "line": 7, "column": 4 }, "end": { "line": 7, "column": 18 } } } ], "range": [ 181, 203 ], "loc": { "start": { "line": 6, "column": 15 }, "end": { "line": 8, "column": 1 } } }, "generator": false, "expression": false, "range": [ 166, 203 ], "loc": { "start": { "line": 6, "column": 0 }, "end": { "line": 8, "column": 1 } } }, { "type": "ExpressionStatement", "expression": { "type": "CallExpression", "callee": { "type": "Identifier", "name": "describe", "range": [ 204, 212 ], "loc": { "start": { "line": 9, "column": 0 }, "end": { "line": 9, "column": 8 } } }, "arguments": [ { "type": "Literal", "value": "Observable.generate", "raw": "'Observable.generate'", "range": [ 213, 234 ], "loc": { "start": { "line": 9, "column": 9 }, "end": { "line": 9, "column": 30 } } }, { "type": "FunctionExpression", "id": null, "params": [], "body": { "type": "BlockStatement", "body": [ { "type": "ExpressionStatement", "expression": { "type": "CallExpression", "callee": { "type": "CallExpression", "callee": { "type": "Identifier", "name": "asDiagram", "range": [ 254, 263 ], "loc": { "start": { "line": 10, "column": 4 }, "end": { "line": 10, "column": 13 } } }, "arguments": [ { "type": "Literal", "value": "generate(1, x => false, x => x + 1)", "raw": "'generate(1, x => false, x => x + 1)'", "range": [ 264, 301 ], "loc": { "start": { "line": 10, "column": 14 }, "end": { "line": 10, "column": 51 } } } ], "range": [ 254, 302 ], "loc": { "start": { "line": 10, "column": 4 }, "end": { "line": 10, "column": 52 } } }, "arguments": [ { "type": "Literal", "value": "should complete if condition does not meet", "raw": "'should complete if condition does not meet'", "range": [ 303, 347 ], "loc": { "start": { "line": 10, "column": 53 }, "end": { "line": 10, "column": 97 } } }, { "type": "FunctionExpression", "id": null, "params": [], "body": { "type": "BlockStatement", "body": [ { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "source", "range": [ 375, 381 ], "loc": { "start": { "line": 11, "column": 12 }, "end": { "line": 11, "column": 18 } } }, "init": { "type": "CallExpression", "callee": { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "Observable", "range": [ 384, 394 ], "loc": { "start": { "line": 11, "column": 21 }, "end": { "line": 11, "column": 31 } } }, "property": { "type": "Identifier", "name": "generate", "range": [ 395, 403 ], "loc": { "start": { "line": 11, "column": 32 }, "end": { "line": 11, "column": 40 } } }, "range": [ 384, 403 ], "loc": { "start": { "line": 11, "column": 21 }, "end": { "line": 11, "column": 40 } } }, "arguments": [ { "type": "Literal", "value": 1, "raw": "1", "range": [ 404, 405 ], "loc": { "start": { "line": 11, "column": 41 }, "end": { "line": 11, "column": 42 } } }, { "type": "FunctionExpression", "id": null, "params": [ { "type": "Identifier", "name": "x", "range": [ 417, 418 ], "loc": { "start": { "line": 11, "column": 54 }, "end": { "line": 11, "column": 55 } } } ], "body": { "type": "BlockStatement", "body": [ { "type": "ReturnStatement", "argument": { "type": "Literal", "value": false, "raw": "false", "range": [ 429, 434 ], "loc": { "start": { "line": 11, "column": 66 }, "end": { "line": 11, "column": 71 } } }, "range": [ 422, 435 ], "loc": { "start": { "line": 11, "column": 59 }, "end": { "line": 11, "column": 72 } } } ], "range": [ 420, 437 ], "loc": { "start": { "line": 11, "column": 57 }, "end": { "line": 11, "column": 74 } } }, "generator": false, "expression": false, "range": [ 407, 437 ], "loc": { "start": { "line": 11, "column": 44 }, "end": { "line": 11, "column": 74 } } }, { "type": "FunctionExpression", "id": null, "params": [ { "type": "Identifier", "name": "x", "range": [ 449, 450 ], "loc": { "start": { "line": 11, "column": 86 }, "end": { "line": 11, "column": 87 } } } ], "body": { "type": "BlockStatement", "body": [ { "type": "ReturnStatement", "argument": { "type": "BinaryExpression", "operator": "+", "left": { "type": "Identifier", "name": "x", "range": [ 461, 462 ], "loc": { "start": { "line": 11, "column": 98 }, "end": { "line": 11, "column": 99 } } }, "right": { "type": "Literal", "value": 1, "raw": "1", "range": [ 465, 466 ], "loc": { "start": { "line": 11, "column": 102 }, "end": { "line": 11, "column": 103 } } }, "range": [ 461, 466 ], "loc": { "start": { "line": 11, "column": 98 }, "end": { "line": 11, "column": 103 } } }, "range": [ 454, 467 ], "loc": { "start": { "line": 11, "column": 91 }, "end": { "line": 11, "column": 104 } } } ], "range": [ 452, 469 ], "loc": { "start": { "line": 11, "column": 89 }, "end": { "line": 11, "column": 106 } } }, "generator": false, "expression": false, "range": [ 439, 469 ], "loc": { "start": { "line": 11, "column": 76 }, "end": { "line": 11, "column": 106 } } } ], "range": [ 384, 470 ], "loc": { "start": { "line": 11, "column": 21 }, "end": { "line": 11, "column": 107 } } }, "range": [ 375, 470 ], "loc": { "start": { "line": 11, "column": 12 }, "end": { "line": 11, "column": 107 } } } ], "kind": "var", "range": [ 371, 471 ], "loc": { "start": { "line": 11, "column": 8 }, "end": { "line": 11, "column": 108 } } }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "expected", "range": [ 484, 492 ], "loc": { "start": { "line": 12, "column": 12 }, "end": { "line": 12, "column": 20 } } }, "init": { "type": "Literal", "value": "|", "raw": "'|'", "range": [ 495, 498 ], "loc": { "start": { "line": 12, "column": 23 }, "end": { "line": 12, "column": 26 } } }, "range": [ 484, 498 ], "loc": { "start": { "line": 12, "column": 12 }, "end": { "line": 12, "column": 26 } } } ], "kind": "var", "range": [ 480, 499 ], "loc": { "start": { "line": 12, "column": 8 }, "end": { "line": 12, "column": 27 } } }, { "type": "ExpressionStatement", "expression": { "type": "CallExpression", "callee": { "type": "MemberExpression", "computed": false, "object": { "type": "CallExpression", "callee": { "type": "Identifier", "name": "expectObservable", "range": [ 508, 524 ], "loc": { "start": { "line": 13, "column": 8 }, "end": { "line": 13, "column": 24 } } }, "arguments": [ { "type": "Identifier", "name": "source", "range": [ 525, 531 ], "loc": { "start": { "line": 13, "column": 25 }, "end": { "line": 13, "column": 31 } } } ], "range": [ 508, 532 ], "loc": { "start": { "line": 13, "column": 8 }, "end": { "line": 13, "column": 32 } } }, "property": { "type": "Identifier", "name": "toBe", "range": [ 533, 537 ], "loc": { "start": { "line": 13, "column": 33 }, "end": { "line": 13, "column": 37 } } }, "range": [ 508, 537 ], "loc": { "start": { "line": 13, "column": 8 }, "end": { "line": 13, "column": 37 } } }, "arguments": [ { "type": "Identifier", "name": "expected", "range": [ 538, 546 ], "loc": { "start": { "line": 13, "column": 38 }, "end": { "line": 13, "column": 46 } } } ], "range": [ 508, 547 ], "loc": { "start": { "line": 13, "column": 8 }, "end": { "line": 13, "column": 47 } } }, "range": [ 508, 548 ], "loc": { "start": { "line": 13, "column": 8 }, "end": { "line": 13, "column": 48 } } } ], "range": [ 361, 554 ], "loc": { "start": { "line": 10, "column": 111 }, "end": { "line": 14, "column": 5 } } }, "generator": false, "expression": false, "range": [ 349, 554 ], "loc": { "start": { "line": 10, "column": 99 }, "end": { "line": 14, "column": 5 } } } ], "range": [ 254, 555 ], "loc": { "start": { "line": 10, "column": 4 }, "end": { "line": 14, "column": 6 } } }, "range": [ 254, 556 ], "loc": { "start": { "line": 10, "column": 4 }, "end": { "line": 14, "column": 7 } } }, { "type": "ExpressionStatement", "expression": { "type": "CallExpression", "callee": { "type": "CallExpression", "callee": { "type": "Identifier", "name": "asDiagram", "range": [ 561, 570 ], "loc": { "start": { "line": 15, "column": 4 }, "end": { "line": 15, "column": 13 } } }, "arguments": [ { "type": "Literal", "value": "generate(1, x => x == 1, x => x + 1)", "raw": "'generate(1, x => x == 1, x => x + 1)'", "range": [ 571, 609 ], "loc": { "start": { "line": 15, "column": 14 }, "end": { "line": 15, "column": 52 } } } ], "range": [ 561, 610 ], "loc": { "start": { "line": 15, "column": 4 }, "end": { "line": 15, "column": 53 } } }, "arguments": [ { "type": "Literal", "value": "should produce first value immediately", "raw": "'should produce first value immediately'", "range": [ 611, 651 ], "loc": { "start": { "line": 15, "column": 54 }, "end": { "line": 15, "column": 94 } } }, { "type": "FunctionExpression", "id": null, "params": [], "body": { "type": "BlockStatement", "body": [ { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": {