UNPKG

@reactivex/rxjs

Version:

Reactive Extensions for modern JavaScript

1,223 lines (1,222 loc) 1.09 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": "sinon", "range": [ 48, 53 ], "loc": { "start": { "line": 3, "column": 4 }, "end": { "line": 3, "column": 9 } } }, "init": { "type": "CallExpression", "callee": { "type": "Identifier", "name": "require", "range": [ 56, 63 ], "loc": { "start": { "line": 3, "column": 12 }, "end": { "line": 3, "column": 19 } } }, "arguments": [ { "type": "Literal", "value": "sinon", "raw": "'sinon'", "range": [ 64, 71 ], "loc": { "start": { "line": 3, "column": 20 }, "end": { "line": 3, "column": 27 } } } ], "range": [ 56, 72 ], "loc": { "start": { "line": 3, "column": 12 }, "end": { "line": 3, "column": 28 } } }, "range": [ 48, 72 ], "loc": { "start": { "line": 3, "column": 4 }, "end": { "line": 3, "column": 28 } } } ], "kind": "var", "range": [ 44, 73 ], "loc": { "start": { "line": 3, "column": 0 }, "end": { "line": 3, "column": 29 } } }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "Rx", "range": [ 78, 80 ], "loc": { "start": { "line": 4, "column": 4 }, "end": { "line": 4, "column": 6 } } }, "init": { "type": "CallExpression", "callee": { "type": "Identifier", "name": "require", "range": [ 83, 90 ], "loc": { "start": { "line": 4, "column": 9 }, "end": { "line": 4, "column": 16 } } }, "arguments": [ { "type": "Literal", "value": "../../dist/cjs/Rx", "raw": "'../../dist/cjs/Rx'", "range": [ 91, 110 ], "loc": { "start": { "line": 4, "column": 17 }, "end": { "line": 4, "column": 36 } } } ], "range": [ 83, 111 ], "loc": { "start": { "line": 4, "column": 9 }, "end": { "line": 4, "column": 37 } } }, "range": [ 78, 111 ], "loc": { "start": { "line": 4, "column": 4 }, "end": { "line": 4, "column": 37 } } } ], "kind": "var", "range": [ 74, 112 ], "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 4, "column": 38 } } }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "Observable", "range": [ 117, 127 ], "loc": { "start": { "line": 5, "column": 4 }, "end": { "line": 5, "column": 14 } } }, "init": { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "Rx", "range": [ 130, 132 ], "loc": { "start": { "line": 5, "column": 17 }, "end": { "line": 5, "column": 19 } } }, "property": { "type": "Identifier", "name": "Observable", "range": [ 133, 143 ], "loc": { "start": { "line": 5, "column": 20 }, "end": { "line": 5, "column": 30 } } }, "range": [ 130, 143 ], "loc": { "start": { "line": 5, "column": 17 }, "end": { "line": 5, "column": 30 } } }, "range": [ 117, 143 ], "loc": { "start": { "line": 5, "column": 4 }, "end": { "line": 5, "column": 30 } } } ], "kind": "var", "range": [ 113, 144 ], "loc": { "start": { "line": 5, "column": 0 }, "end": { "line": 5, "column": 31 } }, "trailingComments": [ { "type": "Block", "value": "* @test {bindCallback} ", "range": [ 145, 172 ], "loc": { "start": { "line": 6, "column": 0 }, "end": { "line": 6, "column": 27 } } } ] }, { "type": "ExpressionStatement", "expression": { "type": "CallExpression", "callee": { "type": "Identifier", "name": "describe", "range": [ 173, 181 ], "loc": { "start": { "line": 7, "column": 0 }, "end": { "line": 7, "column": 8 } } }, "arguments": [ { "type": "Literal", "value": "Observable.bindCallback", "raw": "'Observable.bindCallback'", "range": [ 182, 207 ], "loc": { "start": { "line": 7, "column": 9 }, "end": { "line": 7, "column": 34 } } }, { "type": "FunctionExpression", "id": null, "params": [], "body": { "type": "BlockStatement", "body": [ { "type": "ExpressionStatement", "expression": { "type": "CallExpression", "callee": { "type": "Identifier", "name": "describe", "range": [ 227, 235 ], "loc": { "start": { "line": 8, "column": 4 }, "end": { "line": 8, "column": 12 } } }, "arguments": [ { "type": "Literal", "value": "when not scheduled", "raw": "'when not scheduled'", "range": [ 236, 256 ], "loc": { "start": { "line": 8, "column": 13 }, "end": { "line": 8, "column": 33 } } }, { "type": "FunctionExpression", "id": null, "params": [], "body": { "type": "BlockStatement", "body": [ { "type": "ExpressionStatement", "expression": { "type": "CallExpression", "callee": { "type": "Identifier", "name": "it", "range": [ 280, 282 ], "loc": { "start": { "line": 9, "column": 8 }, "end": { "line": 9, "column": 10 } } }, "arguments": [ { "type": "Literal", "value": "should emit one value from a callback", "raw": "'should emit one value from a callback'", "range": [ 283, 322 ], "loc": { "start": { "line": 9, "column": 11 }, "end": { "line": 9, "column": 50 } } }, { "type": "FunctionExpression", "id": null, "params": [], "body": { "type": "BlockStatement", "body": [ { "type": "FunctionDeclaration", "id": { "type": "Identifier", "name": "callback", "range": [ 359, 367 ], "loc": { "start": { "line": 10, "column": 21 }, "end": { "line": 10, "column": 29 } } }, "params": [ { "type": "Identifier", "name": "datum", "range": [ 368, 373 ], "loc": { "start": { "line": 10, "column": 30 }, "end": { "line": 10, "column": 35 } } }, { "type": "Identifier", "name": "cb", "range": [ 375, 377 ], "loc": { "start": { "line": 10, "column": 37 }, "end": { "line": 10, "column": 39 } } } ], "body": { "type": "BlockStatement", "body": [ { "type": "ExpressionStatement", "expression": { "type": "CallExpression", "callee": { "type": "Identifier", "name": "cb", "range": [ 397, 399 ], "loc": { "start": { "line": 11, "column": 16 }, "end": { "line": 11, "column": 18 } } }, "arguments": [ { "type": "Identifier", "name": "datum", "range": [ 400, 405 ], "loc": { "start": { "line": 11, "column": 19 }, "end": { "line": 11, "column": 24 } } } ], "range": [ 397, 406 ], "loc": { "start": { "line": 11, "column": 16 }, "end": { "line": 11, "column": 25 } } }, "range": [ 397, 407 ], "loc": { "start": { "line": 11, "column": 16 }, "end": { "line": 11, "column": 26 } } } ], "range": [ 379, 421 ], "loc": { "start": { "line": 10, "column": 41 }, "end": { "line": 12, "column": 13 } } }, "generator": false, "expression": false, "range": [ 350, 421 ], "loc": { "start": { "line": 10, "column": 12 }, "end": { "line": 12, "column": 13 } } }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "boundCallback", "range": [ 438, 451 ], "loc": { "start": { "line": 13, "column": 16 }, "end": { "line": 13, "column": 29 } } }, "init": { "type": "CallExpression", "callee": { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "Observable", "range": [ 454, 464 ], "loc": { "start": { "line": 13, "column": 32 }, "end": { "line": 13, "column": 42 } } }, "property": { "type": "Identifier", "name": "bindCallback", "range": [ 465, 477 ], "loc": { "start": { "line": 13, "column": 43 }, "end": { "line": 13, "column": 55 } } }, "range": [ 454, 477 ], "loc": { "start": { "line": 13, "column": 32 }, "end": { "line": 13, "column": 55 } } }, "arguments": [ { "type": "Identifier", "name": "callback", "range": [ 478, 486 ], "loc": { "start": { "line": 13, "column": 56 }, "end": { "line": 13, "column": 64 } } } ], "range": [ 454, 487 ], "loc": { "start": { "line": 13, "column": 32 }, "end": { "line": 13, "column": 65 } } }, "range": [ 438, 487 ], "loc": { "start": { "line": 13, "column": 16 }, "end": { "line": 13, "column": 65 } } } ], "kind": "var", "range": [ 434, 488 ], "loc": { "start": { "line": 13, "column": 12 }, "end": { "line": 13, "column": 66 } } }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "results", "range": [ 505, 512 ], "loc": { "start": { "line": 14, "column": 16 }, "end": { "line": 14, "column": 23 } } }, "init": { "type": "ArrayExpression", "elements": [], "range": [ 515, 517 ], "loc": { "start": { "line": 14, "column": 26 }, "end": { "line": 14, "column": 28 } } }, "range": [ 505, 517 ], "loc": { "start": { "line": 14, "column": 16 }, "end": { "line": 14, "column": 28 } } } ], "kind": "var", "range": [ 501, 518 ], "loc": { "start": { "line": 14, "column": 12 }, "end": { "line": 14, "column": 29 } } }, { "type": "ExpressionStatement", "expression": { "type": "CallExpression", "callee": { "type": "MemberExpression", "computed": false, "object": { "type": "CallExpression", "callee": { "type": "Identifier", "name": "boundCallback", "range": [ 531, 544 ], "loc": { "start": { "line": 15, "column": 12 }, "end": { "line": 15, "column": 25 } } }, "arguments": [ { "type": "Literal", "value": 42, "raw": "42", "range": [ 545, 547 ], "loc": { "start": { "line": 15, "column": 26 }, "end": { "line": 15, "column": 28 } } } ], "range": [ 531, 548 ], "loc": { "start": { "line": 15, "column": 12 }, "end": { "line": 15, "column": 29 } } }, "property": { "type": "Identifier", "name": "subscribe", "range": [ 566, 575 ], "loc": { "start": { "line": 16, "column": 17 }, "end": { "line": 16, "column": 26 } } }, "range": [ 531, 575 ], "loc": { "start": { "line": 15, "column": 12 }, "end": { "line": 16, "column": 26 } } }, "arguments": [ { "type": "FunctionExpression", "id": null, "params": [ { "type": "Identifier", "name": "x", "range": [ 586, 587 ], "loc": { "start": { "line": 16, "column": 37 }, "end": { "line": 16, "column": 38 } } } ], "body": { "type": "BlockStatement", "body": [ { "type": "ExpressionStatement", "expression": { "type": "CallExpression", "callee": { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "results", "range": [ 607, 614 ], "loc": { "start": { "line": 17, "column": 16 }, "end": { "line": 17, "column": 23 } } }, "property": { "type": "Identifier", "name": "push", "range": [ 615, 619 ], "loc": { "start": { "line": 17, "column": 24 }, "end": { "line": 17, "column": 28 } } }, "range": [ 607, 619 ], "loc": { "start": { "line": 17, "column": 16 }, "end": { "line": 17, "column": 28 } } }, "arguments": [ { "type": "Identifier", "name": "x", "range": [ 620, 621 ],