UNPKG

@reactivex/rxjs

Version:

Reactive Extensions for modern JavaScript

1,147 lines (1,146 loc) 866 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 } }, "trailingComments": [ { "type": "Block", "value": "* @test {delayWhen} ", "range": [ 14, 38 ], "loc": { "start": { "line": 2, "column": 0 }, "end": { "line": 2, "column": 24 } } } ] }, { "type": "ExpressionStatement", "expression": { "type": "CallExpression", "callee": { "type": "Identifier", "name": "describe", "range": [ 39, 47 ], "loc": { "start": { "line": 3, "column": 0 }, "end": { "line": 3, "column": 8 } } }, "arguments": [ { "type": "Literal", "value": "Observable.prototype.delayWhen", "raw": "'Observable.prototype.delayWhen'", "range": [ 48, 80 ], "loc": { "start": { "line": 3, "column": 9 }, "end": { "line": 3, "column": 41 } } }, { "type": "FunctionExpression", "id": null, "params": [], "body": { "type": "BlockStatement", "body": [ { "type": "ExpressionStatement", "expression": { "type": "CallExpression", "callee": { "type": "CallExpression", "callee": { "type": "Identifier", "name": "asDiagram", "range": [ 100, 109 ], "loc": { "start": { "line": 4, "column": 4 }, "end": { "line": 4, "column": 13 } } }, "arguments": [ { "type": "Literal", "value": "delayWhen(durationSelector)", "raw": "'delayWhen(durationSelector)'", "range": [ 110, 139 ], "loc": { "start": { "line": 4, "column": 14 }, "end": { "line": 4, "column": 43 } } } ], "range": [ 100, 140 ], "loc": { "start": { "line": 4, "column": 4 }, "end": { "line": 4, "column": 44 } } }, "arguments": [ { "type": "Literal", "value": "should delay by duration selector", "raw": "'should delay by duration selector'", "range": [ 141, 176 ], "loc": { "start": { "line": 4, "column": 45 }, "end": { "line": 4, "column": 80 } } }, { "type": "FunctionExpression", "id": null, "params": [], "body": { "type": "BlockStatement", "body": [ { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "e1", "range": [ 204, 206 ], "loc": { "start": { "line": 5, "column": 12 }, "end": { "line": 5, "column": 14 } } }, "init": { "type": "CallExpression", "callee": { "type": "Identifier", "name": "hot", "range": [ 209, 212 ], "loc": { "start": { "line": 5, "column": 17 }, "end": { "line": 5, "column": 20 } } }, "arguments": [ { "type": "Literal", "value": "---a---b---c--|", "raw": "'---a---b---c--|'", "range": [ 213, 230 ], "loc": { "start": { "line": 5, "column": 21 }, "end": { "line": 5, "column": 38 } } } ], "range": [ 209, 231 ], "loc": { "start": { "line": 5, "column": 17 }, "end": { "line": 5, "column": 39 } } }, "range": [ 204, 231 ], "loc": { "start": { "line": 5, "column": 12 }, "end": { "line": 5, "column": 39 } } } ], "kind": "var", "range": [ 200, 232 ], "loc": { "start": { "line": 5, "column": 8 }, "end": { "line": 5, "column": 40 } } }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "expected", "range": [ 245, 253 ], "loc": { "start": { "line": 6, "column": 12 }, "end": { "line": 6, "column": 20 } } }, "init": { "type": "Literal", "value": "-----a------c----(b|)", "raw": "'-----a------c----(b|)'", "range": [ 256, 279 ], "loc": { "start": { "line": 6, "column": 23 }, "end": { "line": 6, "column": 46 } } }, "range": [ 245, 279 ], "loc": { "start": { "line": 6, "column": 12 }, "end": { "line": 6, "column": 46 } } } ], "kind": "var", "range": [ 241, 280 ], "loc": { "start": { "line": 6, "column": 8 }, "end": { "line": 6, "column": 47 } } }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "subs", "range": [ 293, 297 ], "loc": { "start": { "line": 7, "column": 12 }, "end": { "line": 7, "column": 16 } } }, "init": { "type": "Literal", "value": "^ !", "raw": "'^ !'", "range": [ 300, 320 ], "loc": { "start": { "line": 7, "column": 19 }, "end": { "line": 7, "column": 39 } } }, "range": [ 293, 320 ], "loc": { "start": { "line": 7, "column": 12 }, "end": { "line": 7, "column": 39 } } } ], "kind": "var", "range": [ 289, 321 ], "loc": { "start": { "line": 7, "column": 8 }, "end": { "line": 7, "column": 40 } } }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "selector", "range": [ 334, 342 ], "loc": { "start": { "line": 8, "column": 12 }, "end": { "line": 8, "column": 20 } } }, "init": { "type": "ArrayExpression", "elements": [ { "type": "CallExpression", "callee": { "type": "Identifier", "name": "cold", "range": [ 346, 350 ], "loc": { "start": { "line": 8, "column": 24 }, "end": { "line": 8, "column": 28 } } }, "arguments": [ { "type": "Literal", "value": "--x--|", "raw": "'--x--|'", "range": [ 351, 359 ], "loc": { "start": { "line": 8, "column": 29 }, "end": { "line": 8, "column": 37 } } } ], "range": [ 346, 360 ], "loc": { "start": { "line": 8, "column": 24 }, "end": { "line": 8, "column": 38 } } }, { "type": "CallExpression", "callee": { "type": "Identifier", "name": "cold", "range": [ 374, 378 ], "loc": { "start": { "line": 9, "column": 12 }, "end": { "line": 9, "column": 16 } } }, "arguments": [ { "type": "Literal", "value": "----------(x|)", "raw": "'----------(x|)'", "range": [ 379, 395 ], "loc": { "start": { "line": 9, "column": 17 }, "end": { "line": 9, "column": 33 } } } ], "range": [ 374, 396 ], "loc": { "start": { "line": 9, "column": 12 }, "end": { "line": 9, "column": 34 } } }, { "type": "CallExpression", "callee": { "type": "Identifier", "name": "cold", "range": [ 410, 414 ], "loc": { "start": { "line": 10, "column": 12 }, "end": { "line": 10, "column": 16 } } }, "arguments": [ { "type": "Literal", "value": "-x--|", "raw": "'-x--|'", "range": [ 415, 422 ], "loc": { "start": { "line": 10, "column": 17 }, "end": { "line": 10, "column": 24 } } } ], "range": [ 410, 423 ], "loc": { "start": { "line": 10, "column": 12 }, "end": { "line": 10, "column": 25 } } } ], "range": [ 345, 424 ], "loc": { "start": { "line": 8, "column": 23 }, "end": { "line": 10, "column": 26 } } }, "range": [ 334, 424 ], "loc": { "start": { "line": 8, "column": 12 }, "end": { "line": 10, "column": 26 } } } ], "kind": "var", "range": [ 330, 425 ], "loc": { "start": { "line": 8, "column": 8 }, "end": { "line": 10, "column": 27 } } }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "selectorSubs", "range": [ 438, 450 ], "loc": { "start": { "line": 11, "column": 12 }, "end": { "line": 11, "column": 24 } } }, "init": { "type": "ArrayExpression", "elements": [ { "type": "Literal", "value": " ^ ! ", "raw": "' ^ ! '", "range": [ 454, 474 ], "loc": { "start": { "line": 11, "column": 28 }, "end": { "line": 11, "column": 48 } } }, { "type": "Literal", "value": " ^ !", "raw": "' ^ !'", "range": [ 488, 508 ], "loc": { "start": { "line": 12, "column": 12 }, "end": { "line": 12, "column": 32 } } }, { "type": "Literal", "value": " ^! ", "raw": "' ^! '", "range": [ 522, 542 ], "loc": { "start": { "line": 13, "column": 12 }, "end": { "line": 13, "column": 32 } } } ], "range": [ 453, 543 ], "loc": { "start": { "line": 11, "column": 27 }, "end": { "line": 13, "column": 33 } } }, "range": [ 438, 543 ], "loc": { "start": { "line": 11, "column": 12 }, "end": { "line": 13, "column": 33 } } } ], "kind": "var", "range": [ 434, 544 ], "loc": { "start": { "line": 11, "column": 8 }, "end": { "line": 13, "column": 34 } } }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "idx", "range": [ 557, 560 ], "loc": { "start": { "line": 14, "column": 12 }, "end": { "line": 14, "column": 15 } } }, "init": { "type": "Literal", "value": 0, "raw": "0", "range": [ 563, 564 ], "loc": { "start": { "line": 14, "column": 18 }, "end": { "line": 14, "column": 19 } } }, "range": [ 557, 564 ], "loc": { "start": { "line": 14, "column": 12 }, "end": { "line": 14, "column": 19 } } } ], "kind": "var", "range": [ 553, 565 ], "loc": { "start": { "line": 14, "column": 8 }, "end": { "line": 14, "column": 20 } } }, { "type": "FunctionDeclaration", "id": { "type": "Identifier", "name": "durationSelector", "range": [ 583, 599 ], "loc": { "start": { "line": 15, "column": 17 }, "end": { "line": 15, "column": 33 } } }, "params": [ { "type": "Identifier", "name": "x", "range": [ 600, 601 ], "loc": { "start": { "line": 15, "column": 34 }, "end": { "line": 15, "column": 35 } } } ], "body": { "type": "BlockStatement", "body": [ { "type": "ReturnStatement", "argument": { "type": "MemberExpression", "computed": true, "object": { "type": "Identifier", "name": "selector", "range": [ 624, 632 ], "loc": { "start": { "line": 16, "column": 19 }, "end": { "line": 16, "column": 27 } } }, "property": { "type": "UpdateExpression", "operator": "++", "argument": { "type": "Identifier", "name": "idx", "range": [ 633, 636 ], "loc": { "start": { "line": 16, "column": 28 }, "end": { "line": 16, "column": 31 } } }, "prefix": false, "range": [ 633, 638 ], "loc": { "start": { "line": 16, "column": 28 }, "end": { "line": 16, "column": 33 } } }, "range": [ 624, 639 ], "loc": { "start": { "line": 16, "column": 19 }, "end": { "line": 16, "column": 34 } } }, "range": [ 617, 640 ], "loc": { "start": { "line": 16, "column": 12 }, "end": { "line": 16, "column": 35 } } } ], "range": [ 603, 650 ], "loc": { "start": { "line": 15, "column": 37 }, "end": { "line": 17, "column": 9 } } }, "generator": false, "expression": false, "range": [ 574, 650 ], "loc": { "start": { "line": 15, "column": 8 }, "end": { "line": 17, "column": 9 } } }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "result", "range": [ 663, 669 ], "loc": { "start": { "line": 18, "column": 12 }, "end": { "line": 18, "column": 18 } } }, "init": { "type": "CallExpression", "callee": { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "e1", "range": [ 672, 674 ], "loc": { "start": { "line": 18, "column": 21 }, "end": { "line": 18, "column": 23 } } }, "property": { "type": "Identifier", "name": "delayWhen", "range": [ 675, 684 ], "loc": { "start": { "line": 18, "column": 24 }, "end": { "line": 18, "column": 33 } } }, "range": [ 672, 684 ], "loc": { "start": { "line": 18, "column": 21 }, "end": { "line": 18, "column": 33 } } },