UNPKG

@reactivex/rxjs

Version:

Reactive Extensions for modern JavaScript

1,216 lines 378 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": "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 } } }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "Subscription", "range": [ 119, 131 ], "loc": { "start": { "line": 5, "column": 4 }, "end": { "line": 5, "column": 16 } } }, "init": { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "Rx", "range": [ 134, 136 ], "loc": { "start": { "line": 5, "column": 19 }, "end": { "line": 5, "column": 21 } } }, "property": { "type": "Identifier", "name": "Subscription", "range": [ 137, 149 ], "loc": { "start": { "line": 5, "column": 22 }, "end": { "line": 5, "column": 34 } } }, "range": [ 134, 149 ], "loc": { "start": { "line": 5, "column": 19 }, "end": { "line": 5, "column": 34 } } }, "range": [ 119, 149 ], "loc": { "start": { "line": 5, "column": 4 }, "end": { "line": 5, "column": 34 } } } ], "kind": "var", "range": [ 115, 150 ], "loc": { "start": { "line": 5, "column": 0 }, "end": { "line": 5, "column": 35 } } }, { "type": "ExpressionStatement", "expression": { "type": "CallExpression", "callee": { "type": "Identifier", "name": "describe", "range": [ 151, 159 ], "loc": { "start": { "line": 6, "column": 0 }, "end": { "line": 6, "column": 8 } } }, "arguments": [ { "type": "Literal", "value": "Observable.using", "raw": "'Observable.using'", "range": [ 160, 178 ], "loc": { "start": { "line": 6, "column": 9 }, "end": { "line": 6, "column": 27 } } }, { "type": "FunctionExpression", "id": null, "params": [], "body": { "type": "BlockStatement", "body": [ { "type": "ExpressionStatement", "expression": { "type": "CallExpression", "callee": { "type": "Identifier", "name": "it", "range": [ 198, 200 ], "loc": { "start": { "line": 7, "column": 4 }, "end": { "line": 7, "column": 6 } } }, "arguments": [ { "type": "Literal", "value": "should dispose of the resource when the subscription is disposed", "raw": "'should dispose of the resource when the subscription is disposed'", "range": [ 201, 267 ], "loc": { "start": { "line": 7, "column": 7 }, "end": { "line": 7, "column": 73 } } }, { "type": "FunctionExpression", "id": null, "params": [ { "type": "Identifier", "name": "done", "range": [ 279, 283 ], "loc": { "start": { "line": 7, "column": 85 }, "end": { "line": 7, "column": 89 } } } ], "body": { "type": "BlockStatement", "body": [ { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "disposed", "range": [ 299, 307 ], "loc": { "start": { "line": 8, "column": 12 }, "end": { "line": 8, "column": 20 } } }, "init": { "type": "Literal", "value": false, "raw": "false", "range": [ 310, 315 ], "loc": { "start": { "line": 8, "column": 23 }, "end": { "line": 8, "column": 28 } } }, "range": [ 299, 315 ], "loc": { "start": { "line": 8, "column": 12 }, "end": { "line": 8, "column": 28 } } } ], "kind": "var", "range": [ 295, 316 ], "loc": { "start": { "line": 8, "column": 8 }, "end": { "line": 8, "column": 29 } } }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "source", "range": [ 329, 335 ], "loc": { "start": { "line": 9, "column": 12 }, "end": { "line": 9, "column": 18 } } }, "init": { "type": "CallExpression", "callee": { "type": "MemberExpression", "computed": false, "object": { "type": "CallExpression", "callee": { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "Observable", "range": [ 338, 348 ], "loc": { "start": { "line": 9, "column": 21 }, "end": { "line": 9, "column": 31 } } }, "property": { "type": "Identifier", "name": "using", "range": [ 349, 354 ], "loc": { "start": { "line": 9, "column": 32 }, "end": { "line": 9, "column": 37 } } }, "range": [ 338, 354 ], "loc": { "start": { "line": 9, "column": 21 }, "end": { "line": 9, "column": 37 } } }, "arguments": [ { "type": "FunctionExpression", "id": null, "params": [], "body": { "type": "BlockStatement", "body": [ { "type": "ReturnStatement", "argument": { "type": "NewExpression", "callee": { "type": "Identifier", "name": "Subscription", "range": [ 380, 392 ], "loc": { "start": { "line": 9, "column": 63 }, "end": { "line": 9, "column": 75 } } }, "arguments": [ { "type": "FunctionExpression", "id": null, "params": [], "body": { "type": "BlockStatement", "body": [ { "type": "ReturnStatement", "argument": { "type": "AssignmentExpression", "operator": "=", "left": { "type": "Identifier", "name": "disposed", "range": [ 414, 422 ], "loc": { "start": { "line": 9, "column": 97 }, "end": { "line": 9, "column": 105 } } }, "right": { "type": "Literal", "value": true, "raw": "true", "range": [ 425, 429 ], "loc": { "start": { "line": 9, "column": 108 }, "end": { "line": 9, "column": 112 } } }, "range": [ 414, 429 ], "loc": { "start": { "line": 9, "column": 97 }, "end": { "line": 9, "column": 112 } } }, "range": [ 407, 430 ], "loc": { "start": { "line": 9, "column": 90 }, "end": { "line": 9, "column": 113 } } } ], "range": [ 405, 432 ], "loc": { "start": { "line": 9, "column": 88 }, "end": { "line": 9, "column": 115 } } }, "generator": false, "expression": false, "range": [ 393, 432 ], "loc": { "start": { "line": 9, "column": 76 }, "end": { "line": 9, "column": 115 } } } ], "range": [ 376, 433 ], "loc": { "start": { "line": 9, "column": 59 }, "end": { "line": 9, "column": 116 } } }, "range": [ 369, 434 ], "loc": { "start": { "line": 9, "column": 52 }, "end": { "line": 9, "column": 117 } } } ], "range": [ 367, 436 ], "loc": { "start": { "line": 9, "column": 50 }, "end": { "line": 9, "column": 119 } } }, "generator": false, "expression": false, "range": [ 355, 436 ], "loc": { "start": { "line": 9, "column": 38 }, "end": { "line": 9, "column": 119 } } }, { "type": "FunctionExpression", "id": null, "params": [ { "type": "Identifier", "name": "resource", "range": [ 448, 456 ], "loc": { "start": { "line": 9, "column": 131 }, "end": { "line": 9, "column": 139 } } } ], "body": { "type": "BlockStatement", "body": [ { "type": "ReturnStatement", "argument": { "type": "CallExpression", "callee": { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "Observable", "range": [ 467, 477 ], "loc": { "start": { "line": 9, "column": 150 }, "end": { "line": 9, "column": 160 } } }, "property": { "type": "Identifier", "name": "range", "range": [ 478, 483 ], "loc": { "start": { "line": 9, "column": 161 }, "end": { "line": 9, "column": 166 } } }, "range": [ 467, 483 ], "loc": { "start": { "line": 9, "column": 150 }, "end": { "line": 9, "column": 166 } } }, "arguments": [ { "type": "Literal", "value": 0, "raw": "0", "range": [ 484, 485 ], "loc": { "start": { "line": 9, "column": 167 }, "end": { "line": 9, "column": 168 } } }, { "type": "Literal", "value": 3, "raw": "3", "range": [ 487, 488 ], "loc": { "start": { "line": 9, "column": 170 }, "end": { "line": 9, "column": 171 } } } ], "range": [ 467, 489 ], "loc": { "start": { "line": 9, "column": 150 }, "end": { "line": 9, "column": 172 } } }, "range": [ 460, 490 ], "loc": { "start": { "line": 9, "column": 143 }, "end": { "line": 9, "column": 173 } } } ], "range": [ 458, 492 ], "loc": { "start": { "line": 9, "column": 141 }, "end": { "line": 9, "column": 175 } } }, "generator": false, "expression": false, "range": [ 438, 492 ], "loc": { "start": { "line": 9, "column": 121 }, "end": { "line": 9, "column": 175 } } } ], "range": [ 338, 493 ], "loc": { "start": { "line": 9, "column": 21 }, "end": { "line": 9, "column": 176 } } }, "property": { "type": "Identifier", "name": "take", "range": [ 507, 511 ], "loc": { "start": { "line": 10, "column": 13 }, "end": { "line": 10, "column": 17 } } }, "range": [ 338, 511 ], "loc": { "start": { "line": 9, "column": 21 }, "end": { "line": 10, "column": 17 } } }, "arguments": [ { "type": "Literal", "value": 2, "raw": "2", "range": [ 512, 513 ], "loc": { "start": { "line": 10, "column": 18 }, "end": { "line": 10, "column": 19 } }