UNPKG

@reactivex/rxjs

Version:

Reactive Extensions for modern JavaScript

1,326 lines (1,325 loc) 1.4 MB
{ "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": "chai_1", "range": [ 18, 24 ], "loc": { "start": { "line": 2, "column": 4 }, "end": { "line": 2, "column": 10 } } }, "init": { "type": "CallExpression", "callee": { "type": "Identifier", "name": "require", "range": [ 27, 34 ], "loc": { "start": { "line": 2, "column": 13 }, "end": { "line": 2, "column": 20 } } }, "arguments": [ { "type": "Literal", "value": "chai", "raw": "'chai'", "range": [ 35, 41 ], "loc": { "start": { "line": 2, "column": 21 }, "end": { "line": 2, "column": 27 } } } ], "range": [ 27, 42 ], "loc": { "start": { "line": 2, "column": 13 }, "end": { "line": 2, "column": 28 } } }, "range": [ 18, 42 ], "loc": { "start": { "line": 2, "column": 4 }, "end": { "line": 2, "column": 28 } } } ], "kind": "var", "range": [ 14, 43 ], "loc": { "start": { "line": 2, "column": 0 }, "end": { "line": 2, "column": 29 } } }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "Rx", "range": [ 48, 50 ], "loc": { "start": { "line": 3, "column": 4 }, "end": { "line": 3, "column": 6 } } }, "init": { "type": "CallExpression", "callee": { "type": "Identifier", "name": "require", "range": [ 53, 60 ], "loc": { "start": { "line": 3, "column": 9 }, "end": { "line": 3, "column": 16 } } }, "arguments": [ { "type": "Literal", "value": "../../dist/cjs/Rx", "raw": "'../../dist/cjs/Rx'", "range": [ 61, 80 ], "loc": { "start": { "line": 3, "column": 17 }, "end": { "line": 3, "column": 36 } } } ], "range": [ 53, 81 ], "loc": { "start": { "line": 3, "column": 9 }, "end": { "line": 3, "column": 37 } } }, "range": [ 48, 81 ], "loc": { "start": { "line": 3, "column": 4 }, "end": { "line": 3, "column": 37 } } } ], "kind": "var", "range": [ 44, 82 ], "loc": { "start": { "line": 3, "column": 0 }, "end": { "line": 3, "column": 38 } } }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "Observable", "range": [ 87, 97 ], "loc": { "start": { "line": 4, "column": 4 }, "end": { "line": 4, "column": 14 } } }, "init": { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "Rx", "range": [ 100, 102 ], "loc": { "start": { "line": 4, "column": 17 }, "end": { "line": 4, "column": 19 } } }, "property": { "type": "Identifier", "name": "Observable", "range": [ 103, 113 ], "loc": { "start": { "line": 4, "column": 20 }, "end": { "line": 4, "column": 30 } } }, "range": [ 100, 113 ], "loc": { "start": { "line": 4, "column": 17 }, "end": { "line": 4, "column": 30 } } }, "range": [ 87, 113 ], "loc": { "start": { "line": 4, "column": 4 }, "end": { "line": 4, "column": 30 } } } ], "kind": "var", "range": [ 83, 114 ], "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 4, "column": 31 } }, "trailingComments": [ { "type": "Block", "value": "* @test {throttle} ", "range": [ 115, 138 ], "loc": { "start": { "line": 5, "column": 0 }, "end": { "line": 5, "column": 23 } } } ] }, { "type": "ExpressionStatement", "expression": { "type": "CallExpression", "callee": { "type": "Identifier", "name": "describe", "range": [ 139, 147 ], "loc": { "start": { "line": 6, "column": 0 }, "end": { "line": 6, "column": 8 } } }, "arguments": [ { "type": "Literal", "value": "Observable.prototype.throttle", "raw": "'Observable.prototype.throttle'", "range": [ 148, 179 ], "loc": { "start": { "line": 6, "column": 9 }, "end": { "line": 6, "column": 40 } } }, { "type": "FunctionExpression", "id": null, "params": [], "body": { "type": "BlockStatement", "body": [ { "type": "ExpressionStatement", "expression": { "type": "CallExpression", "callee": { "type": "CallExpression", "callee": { "type": "Identifier", "name": "asDiagram", "range": [ 199, 208 ], "loc": { "start": { "line": 7, "column": 4 }, "end": { "line": 7, "column": 13 } } }, "arguments": [ { "type": "Literal", "value": "throttle", "raw": "'throttle'", "range": [ 209, 219 ], "loc": { "start": { "line": 7, "column": 14 }, "end": { "line": 7, "column": 24 } } } ], "range": [ 199, 220 ], "loc": { "start": { "line": 7, "column": 4 }, "end": { "line": 7, "column": 25 } } }, "arguments": [ { "type": "Literal", "value": "should immediately emit the first value in each time window", "raw": "'should immediately emit the first value in each time window'", "range": [ 221, 282 ], "loc": { "start": { "line": 7, "column": 26 }, "end": { "line": 7, "column": 87 } } }, { "type": "FunctionExpression", "id": null, "params": [], "body": { "type": "BlockStatement", "body": [ { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "e1", "range": [ 310, 312 ], "loc": { "start": { "line": 8, "column": 12 }, "end": { "line": 8, "column": 14 } } }, "init": { "type": "CallExpression", "callee": { "type": "Identifier", "name": "hot", "range": [ 315, 318 ], "loc": { "start": { "line": 8, "column": 17 }, "end": { "line": 8, "column": 20 } } }, "arguments": [ { "type": "Literal", "value": "-a-xy-----b--x--cxxx-|", "raw": "'-a-xy-----b--x--cxxx-|'", "range": [ 319, 343 ], "loc": { "start": { "line": 8, "column": 21 }, "end": { "line": 8, "column": 45 } } } ], "range": [ 315, 344 ], "loc": { "start": { "line": 8, "column": 17 }, "end": { "line": 8, "column": 46 } } }, "range": [ 310, 344 ], "loc": { "start": { "line": 8, "column": 12 }, "end": { "line": 8, "column": 46 } } } ], "kind": "var", "range": [ 306, 345 ], "loc": { "start": { "line": 8, "column": 8 }, "end": { "line": 8, "column": 47 } } }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "e1subs", "range": [ 358, 364 ], "loc": { "start": { "line": 9, "column": 12 }, "end": { "line": 9, "column": 18 } } }, "init": { "type": "Literal", "value": "^ !", "raw": "'^ !'", "range": [ 367, 391 ], "loc": { "start": { "line": 9, "column": 21 }, "end": { "line": 9, "column": 45 } } }, "range": [ 358, 391 ], "loc": { "start": { "line": 9, "column": 12 }, "end": { "line": 9, "column": 45 } } } ], "kind": "var", "range": [ 354, 392 ], "loc": { "start": { "line": 9, "column": 8 }, "end": { "line": 9, "column": 46 } } }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "e2", "range": [ 405, 407 ], "loc": { "start": { "line": 10, "column": 12 }, "end": { "line": 10, "column": 14 } } }, "init": { "type": "CallExpression", "callee": { "type": "Identifier", "name": "cold", "range": [ 410, 414 ], "loc": { "start": { "line": 10, "column": 17 }, "end": { "line": 10, "column": 21 } } }, "arguments": [ { "type": "Literal", "value": "----| ", "raw": "'----| '", "range": [ 415, 438 ], "loc": { "start": { "line": 10, "column": 22 }, "end": { "line": 10, "column": 45 } } } ], "range": [ 410, 439 ], "loc": { "start": { "line": 10, "column": 17 }, "end": { "line": 10, "column": 46 } } }, "range": [ 405, 439 ], "loc": { "start": { "line": 10, "column": 12 }, "end": { "line": 10, "column": 46 } } } ], "kind": "var", "range": [ 401, 440 ], "loc": { "start": { "line": 10, "column": 8 }, "end": { "line": 10, "column": 47 } } }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "e2subs", "range": [ 453, 459 ], "loc": { "start": { "line": 11, "column": 12 }, "end": { "line": 11, "column": 18 } } }, "init": { "type": "ArrayExpression", "elements": [ { "type": "Literal", "value": " ^ ! ", "raw": "' ^ ! '", "range": [ 463, 487 ], "loc": { "start": { "line": 11, "column": 22 }, "end": { "line": 11, "column": 46 } } }, { "type": "Literal", "value": " ^ ! ", "raw": "' ^ ! '", "range": [ 501, 525 ], "loc": { "start": { "line": 12, "column": 12 }, "end": { "line": 12, "column": 36 } } }, { "type": "Literal", "value": " ^ ! ", "raw": "' ^ ! '", "range": [ 539, 563 ], "loc": { "start": { "line": 13, "column": 12 }, "end": { "line": 13, "column": 36 } } } ], "range": [ 462, 564 ], "loc": { "start": { "line": 11, "column": 21 }, "end": { "line": 13, "column": 37 } } }, "range": [ 453, 564 ], "loc": { "start": { "line": 11, "column": 12 }, "end": { "line": 13, "column": 37 } } } ], "kind": "var", "range": [ 449, 565 ], "loc": { "start": { "line": 11, "column": 8 }, "end": { "line": 13, "column": 38 } } }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "expected", "range": [ 578, 586 ], "loc": { "start": { "line": 14, "column": 12 }, "end": { "line": 14, "column": 20 } } }, "init": { "type": "Literal", "value": "-a--------b-----c----|", "raw": "'-a--------b-----c----|'", "range": [ 589, 613 ], "loc": { "start": { "line": 14, "column": 23 }, "end": { "line": 14, "column": 47 } } }, "range": [ 578, 613 ], "loc": { "start": { "line": 14, "column": 12 }, "end": { "line": 14, "column": 47 } } } ], "kind": "var", "range": [ 574, 614 ], "loc": { "start": { "line": 14, "column": 8 }, "end": { "line": 14, "column": 48 } } }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "result", "range": [ 627, 633 ], "loc": { "start": { "line": 15, "column": 12 }, "end": { "line": 15, "column": 18 } } }, "init": { "type": "CallExpression", "callee": { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "e1", "range": [ 636, 638 ], "loc": { "start": { "line": 15, "column": 21 }, "end": { "line": 15, "column": 23 } } }, "property": { "type": "Identifier", "name": "throttle", "range": [ 639, 647 ], "loc": { "start": { "line": 15, "column": 24 }, "end": { "line": 15, "column": 32 } } }, "range": [ 636, 647 ], "loc": { "start": { "line": 15, "column": 21 }, "end": { "line": 15, "column": 32 } } }, "arguments": [ { "type": "FunctionExpression", "id": null, "params": [], "body": { "type": "BlockStatement", "body": [ { "type": "ReturnStatement", "argument": { "type": "Identifier", "name": "e2", "range": [ 669, 671 ], "loc": { "start": { "line": 15, "column": 54 }, "end": { "line": 15, "column": 56 } } }, "range": [ 662, 672 ], "loc": { "start": { "line": 15, "column": 47 }, "end": { "line": 15, "column": 57 } } } ], "range": [ 660, 674 ], "loc": { "start": { "line": 15, "column": 45 }, "end": { "line": 15, "column": 59 } } }, "generator": false, "expression": false, "range": [ 648, 674 ], "loc": { "start": { "line": 15, "column": 33 }, "end": { "line": 15, "column": 59 } } } ], "range": [ 636, 675 ], "loc": { "start": { "line": 15, "column": 21 }, "end": { "line": 15, "column": 60 } } }, "range": [ 627, 675 ], "loc": { "start": { "line": 15, "column": 12 }, "end": { "line": 15, "column": 60 } } } ], "kind": "var", "range": [ 623, 676 ], "loc": { "start": { "line": 15, "column": 8 }, "end": { "line": 15, "column": 61 } } }, { "type": "ExpressionStatement", "expression": { "type": "CallExpression", "callee": { "type": "MemberExpression", "computed": false, "object": { "type": "CallExpression", "callee": { "type": "Identifier", "name": "expectObservable", "range": [ 685, 701 ], "loc": { "start": { "line": 16, "column": 8 }, "end": { "line": 16, "column": 24 } } }, "arguments": [ { "type": "Identifier", "name": "result", "range": [ 702, 708 ], "loc": { "start": { "line": 16, "column": 25 }, "end": { "line": 16, "column": 31 } } } ], "range": [ 685, 709 ], "loc": { "start": { "line": 16, "column": 8 }, "end": { "line": 16, "column": 32 } } }, "property": { "type": "Identifier", "name": "toBe", "range": [ 710, 714 ], "loc": { "start": { "line": 16, "column": 33 }, "end": { "line": 16, "column": 37 } } }, "range": [ 685, 714 ], "loc": { "start": { "line": 16, "column": 8 }, "end": { "line": 16, "column": 37 } } },