UNPKG

@reactivex/rxjs

Version:

Reactive Extensions for modern JavaScript

1,196 lines (1,195 loc) 439 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 } }, "trailingComments": [ { "type": "Block", "value": "* @test {fromEventPattern} ", "range": [ 115, 146 ], "loc": { "start": { "line": 5, "column": 0 }, "end": { "line": 5, "column": 31 } } } ] }, { "type": "ExpressionStatement", "expression": { "type": "CallExpression", "callee": { "type": "Identifier", "name": "describe", "range": [ 147, 155 ], "loc": { "start": { "line": 6, "column": 0 }, "end": { "line": 6, "column": 8 } } }, "arguments": [ { "type": "Literal", "value": "Observable.fromEventPattern", "raw": "'Observable.fromEventPattern'", "range": [ 156, 185 ], "loc": { "start": { "line": 6, "column": 9 }, "end": { "line": 6, "column": 38 } } }, { "type": "FunctionExpression", "id": null, "params": [], "body": { "type": "BlockStatement", "body": [ { "type": "ExpressionStatement", "expression": { "type": "CallExpression", "callee": { "type": "CallExpression", "callee": { "type": "Identifier", "name": "asDiagram", "range": [ 205, 214 ], "loc": { "start": { "line": 7, "column": 4 }, "end": { "line": 7, "column": 13 } } }, "arguments": [ { "type": "Literal", "value": "fromEventPattern(addHandler, removeHandler)", "raw": "'fromEventPattern(addHandler, removeHandler)'", "range": [ 215, 260 ], "loc": { "start": { "line": 7, "column": 14 }, "end": { "line": 7, "column": 59 } } } ], "range": [ 205, 261 ], "loc": { "start": { "line": 7, "column": 4 }, "end": { "line": 7, "column": 60 } } }, "arguments": [ { "type": "Literal", "value": "should create an observable from the handler API", "raw": "'should create an observable from the handler API'", "range": [ 262, 312 ], "loc": { "start": { "line": 7, "column": 61 }, "end": { "line": 7, "column": 111 } } }, { "type": "FunctionExpression", "id": null, "params": [], "body": { "type": "BlockStatement", "body": [ { "type": "FunctionDeclaration", "id": { "type": "Identifier", "name": "addHandler", "range": [ 345, 355 ], "loc": { "start": { "line": 8, "column": 17 }, "end": { "line": 8, "column": 27 } } }, "params": [ { "type": "Identifier", "name": "h", "range": [ 356, 357 ], "loc": { "start": { "line": 8, "column": 28 }, "end": { "line": 8, "column": 29 } } } ], "body": { "type": "BlockStatement", "body": [ { "type": "ExpressionStatement", "expression": { "type": "CallExpression", "callee": { "type": "MemberExpression", "computed": false, "object": { "type": "CallExpression", "callee": { "type": "MemberExpression", "computed": false, "object": { "type": "CallExpression", "callee": { "type": "MemberExpression", "computed": false, "object": { "type": "CallExpression", "callee": { "type": "MemberExpression", "computed": false, "object": { "type": "CallExpression", "callee": { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "Observable", "range": [ 373, 383 ], "loc": { "start": { "line": 9, "column": 12 }, "end": { "line": 9, "column": 22 } } }, "property": { "type": "Identifier", "name": "timer", "range": [ 384, 389 ], "loc": { "start": { "line": 9, "column": 23 }, "end": { "line": 9, "column": 28 } } }, "range": [ 373, 389 ], "loc": { "start": { "line": 9, "column": 12 }, "end": { "line": 9, "column": 28 } } }, "arguments": [ { "type": "Literal", "value": 50, "raw": "50", "range": [ 390, 392 ], "loc": { "start": { "line": 9, "column": 29 }, "end": { "line": 9, "column": 31 } } }, { "type": "Literal", "value": 20, "raw": "20", "range": [ 394, 396 ], "loc": { "start": { "line": 9, "column": 33 }, "end": { "line": 9, "column": 35 } } }, { "type": "Identifier", "name": "rxTestScheduler", "range": [ 398, 413 ], "loc": { "start": { "line": 9, "column": 37 }, "end": { "line": 9, "column": 52 } } } ], "range": [ 373, 414 ], "loc": { "start": { "line": 9, "column": 12 }, "end": { "line": 9, "column": 53 } } }, "property": { "type": "Identifier", "name": "mapTo", "range": [ 432, 437 ], "loc": { "start": { "line": 10, "column": 17 }, "end": { "line": 10, "column": 22 } } }, "range": [ 373, 437 ], "loc": { "start": { "line": 9, "column": 12 }, "end": { "line": 10, "column": 22 } } }, "arguments": [ { "type": "Literal", "value": "ev", "raw": "'ev'", "range": [ 438, 442 ], "loc": { "start": { "line": 10, "column": 23 }, "end": { "line": 10, "column": 27 } } } ], "range": [ 373, 443 ], "loc": { "start": { "line": 9, "column": 12 }, "end": { "line": 10, "column": 28 } } }, "property": { "type": "Identifier", "name": "take", "range": [ 461, 465 ], "loc": { "start": { "line": 11, "column": 17 }, "end": { "line": 11, "column": 21 } } }, "range": [ 373, 465 ], "loc": { "start": { "line": 9, "column": 12 }, "end": { "line": 11, "column": 21 } } }, "arguments": [ { "type": "Literal", "value": 2, "raw": "2", "range": [ 466, 467 ], "loc": { "start": { "line": 11, "column": 22 }, "end": { "line": 11, "column": 23 } } } ], "range": [ 373, 468 ], "loc": { "start": { "line": 9, "column": 12 }, "end": { "line": 11, "column": 24 } } }, "property": { "type": "Identifier", "name": "concat", "range": [ 486, 492 ], "loc": { "start": { "line": 12, "column": 17 }, "end": { "line": 12, "column": 23 } } }, "range": [ 373, 492 ], "loc": { "start": { "line": 9, "column": 12 }, "end": { "line": 12, "column": 23 } } }, "arguments": [ { "type": "CallExpression", "callee": { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "Observable", "range": [ 493, 503 ], "loc": { "start": { "line": 12, "column": 24 }, "end": { "line": 12, "column": 34 } } }, "property": { "type": "Identifier", "name": "never", "range": [ 504, 509 ], "loc": { "start": { "line": 12, "column": 35 }, "end": { "line": 12, "column": 40 } } }, "range": [ 493, 509 ], "loc": { "start": { "line": 12, "column": 24 }, "end": { "line": 12, "column": 40 } } }, "arguments": [], "range": [ 493, 511 ], "loc": { "start": { "line": 12, "column": 24 }, "end": { "line": 12, "column": 42 } } } ], "range": [ 373, 512 ], "loc": { "start": { "line": 9, "column": 12 }, "end": { "line": 12, "column": 43 } } }, "property": { "type": "Identifier", "name": "subscribe", "range": [ 530, 539 ], "loc": { "start": { "line": 13, "column": 17 }, "end": { "line": 13, "column": 26 } } }, "range": [ 373, 539 ], "loc": { "start": { "line": 9, "column": 12 }, "end": { "line": 13, "column": 26 } } }, "arguments": [ { "type": "Identifier", "name": "h", "range": [ 540, 541 ], "loc": { "start": { "line": 13, "column": 27 }, "end": { "line": 13, "column": 28 } } } ], "range": [ 373, 542 ], "loc": { "start": { "line": 9, "column": 12 }, "end": { "line": 13, "column": 29 } } }, "range": [ 373, 543 ], "loc": { "start": { "line": 9, "column": 12 }, "end": { "line": 13, "column": 30 } } } ], "range": [ 359, 553 ], "loc": { "start": { "line": 8, "column": 31 }, "end": { "line": 14, "column": 9 } } }, "generator": false, "expression": false, "range": [ 336, 553 ], "loc": { "start": { "line": 8, "column": 8 }, "end": { "line": 14, "column": 9 } } }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "e1", "range": [ 566, 568 ], "loc": { "start": { "line": 15, "column": 12 }, "end": { "line": 15, "column": 14 } } }, "init": { "type": "CallExpression", "callee": { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "Observable", "range": [ 571, 581 ], "loc": { "start": { "line": 15, "column": 17 }, "end": { "line": 15, "column": 27 } } }, "property": { "type": "Identifier", "name": "fromEventPattern", "range": [ 582, 598 ], "loc": { "start": { "line": 15, "column": 28 }, "end": { "line": 15, "column": 44 } } }, "range": [ 571, 598 ], "loc": { "start": { "line": 15, "column": 17 }, "end": { "line": 15, "column": 44 } } }, "arguments": [ { "type": "Identifier", "name": "addHandler", "range": [ 599, 609 ], "loc": { "start": { "line": 15, "column": 45 }, "end": { "line": 15, "column": 55 } } }, {