UNPKG

@reactivex/rxjs

Version:

Reactive Extensions for modern JavaScript

1,571 lines (1,570 loc) 1.24 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": "Line", "value": " function shortcuts", "range": [ 115, 136 ], "loc": { "start": { "line": 5, "column": 0 }, "end": { "line": 5, "column": 21 } } } ] }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "addDrama", "range": [ 141, 149 ], "loc": { "start": { "line": 6, "column": 4 }, "end": { "line": 6, "column": 12 } } }, "init": { "type": "FunctionExpression", "id": null, "params": [ { "type": "Identifier", "name": "x", "range": [ 162, 163 ], "loc": { "start": { "line": 6, "column": 25 }, "end": { "line": 6, "column": 26 } } } ], "body": { "type": "BlockStatement", "body": [ { "type": "ReturnStatement", "argument": { "type": "BinaryExpression", "operator": "+", "left": { "type": "Identifier", "name": "x", "range": [ 174, 175 ], "loc": { "start": { "line": 6, "column": 37 }, "end": { "line": 6, "column": 38 } } }, "right": { "type": "Literal", "value": "!", "raw": "'!'", "range": [ 178, 181 ], "loc": { "start": { "line": 6, "column": 41 }, "end": { "line": 6, "column": 44 } } }, "range": [ 174, 181 ], "loc": { "start": { "line": 6, "column": 37 }, "end": { "line": 6, "column": 44 } } }, "range": [ 167, 182 ], "loc": { "start": { "line": 6, "column": 30 }, "end": { "line": 6, "column": 45 } } } ], "range": [ 165, 184 ], "loc": { "start": { "line": 6, "column": 28 }, "end": { "line": 6, "column": 47 } } }, "generator": false, "expression": false, "range": [ 152, 184 ], "loc": { "start": { "line": 6, "column": 15 }, "end": { "line": 6, "column": 47 } } }, "range": [ 141, 184 ], "loc": { "start": { "line": 6, "column": 4 }, "end": { "line": 6, "column": 47 } } } ], "kind": "var", "range": [ 137, 185 ], "loc": { "start": { "line": 6, "column": 0 }, "end": { "line": 6, "column": 48 } }, "leadingComments": [ { "type": "Line", "value": " function shortcuts", "range": [ 115, 136 ], "loc": { "start": { "line": 5, "column": 0 }, "end": { "line": 5, "column": 21 } } } ] }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "identity", "range": [ 190, 198 ], "loc": { "start": { "line": 7, "column": 4 }, "end": { "line": 7, "column": 12 } } }, "init": { "type": "FunctionExpression", "id": null, "params": [ { "type": "Identifier", "name": "x", "range": [ 211, 212 ], "loc": { "start": { "line": 7, "column": 25 }, "end": { "line": 7, "column": 26 } } } ], "body": { "type": "BlockStatement", "body": [ { "type": "ReturnStatement", "argument": { "type": "Identifier", "name": "x", "range": [ 223, 224 ], "loc": { "start": { "line": 7, "column": 37 }, "end": { "line": 7, "column": 38 } } }, "range": [ 216, 225 ], "loc": { "start": { "line": 7, "column": 30 }, "end": { "line": 7, "column": 39 } } } ], "range": [ 214, 227 ], "loc": { "start": { "line": 7, "column": 28 }, "end": { "line": 7, "column": 41 } } }, "generator": false, "expression": false, "range": [ 201, 227 ], "loc": { "start": { "line": 7, "column": 15 }, "end": { "line": 7, "column": 41 } } }, "range": [ 190, 227 ], "loc": { "start": { "line": 7, "column": 4 }, "end": { "line": 7, "column": 41 } } } ], "kind": "var", "range": [ 186, 228 ], "loc": { "start": { "line": 7, "column": 0 }, "end": { "line": 7, "column": 42 } } }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "throwError", "range": [ 233, 243 ], "loc": { "start": { "line": 8, "column": 4 }, "end": { "line": 8, "column": 14 } } }, "init": { "type": "FunctionExpression", "id": null, "params": [], "body": { "type": "BlockStatement", "body": [ { "type": "ThrowStatement", "argument": { "type": "NewExpression", "callee": { "type": "Identifier", "name": "Error", "range": [ 270, 275 ], "loc": { "start": { "line": 8, "column": 41 }, "end": { "line": 8, "column": 46 } } }, "arguments": [], "range": [ 266, 277 ], "loc": { "start": { "line": 8, "column": 37 }, "end": { "line": 8, "column": 48 } } }, "range": [ 260, 278 ], "loc": { "start": { "line": 8, "column": 31 }, "end": { "line": 8, "column": 49 } } } ], "range": [ 258, 280 ], "loc": { "start": { "line": 8, "column": 29 }, "end": { "line": 8, "column": 51 } } }, "generator": false, "expression": false, "range": [ 246, 280 ], "loc": { "start": { "line": 8, "column": 17 }, "end": { "line": 8, "column": 51 } } }, "range": [ 233, 280 ], "loc": { "start": { "line": 8, "column": 4 }, "end": { "line": 8, "column": 51 } } } ], "kind": "var", "range": [ 229, 281 ], "loc": { "start": { "line": 8, "column": 0 }, "end": { "line": 8, "column": 52 } }, "trailingComments": [ { "type": "Block", "value": "* @test {map} ", "range": [ 282, 300 ], "loc": { "start": { "line": 9, "column": 0 }, "end": { "line": 9, "column": 18 } } } ] }, { "type": "ExpressionStatement", "expression": { "type": "CallExpression", "callee": { "type": "Identifier", "name": "describe", "range": [ 301, 309 ], "loc": { "start": { "line": 10, "column": 0 }, "end": { "line": 10, "column": 8 } } }, "arguments": [ { "type": "Literal", "value": "Observable.prototype.map", "raw": "'Observable.prototype.map'", "range": [ 310, 336 ], "loc": { "start": { "line": 10, "column": 9 }, "end": { "line": 10, "column": 35 } } }, { "type": "FunctionExpression", "id": null, "params": [], "body": { "type": "BlockStatement", "body": [ { "type": "ExpressionStatement", "expression": { "type": "CallExpression", "callee": { "type": "CallExpression", "callee": { "type": "Identifier", "name": "asDiagram", "range": [ 356, 365 ], "loc": { "start": { "line": 11, "column": 4 }, "end": { "line": 11, "column": 13 } } }, "arguments": [ { "type": "Literal", "value": "map(x => 10 * x)", "raw": "'map(x => 10 * x)'", "range": [ 366, 384 ], "loc": { "start": { "line": 11, "column": 14 }, "end": { "line": 11, "column": 32 } } } ], "range": [ 356, 385 ], "loc": { "start": { "line": 11, "column": 4 }, "end": { "line": 11, "column": 33 } } }, "arguments": [ { "type": "Literal", "value": "should map multiple values", "raw": "'should map multiple values'", "range": [ 386, 414 ], "loc": { "start": { "line": 11, "column": 34 }, "end": { "line": 11, "column": 62 } } }, { "type": "FunctionExpression", "id": null, "params": [], "body": { "type": "BlockStatement", "body": [ { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "a", "range": [ 442, 443 ], "loc": { "start": { "line": 12, "column": 12 }, "end": { "line": 12, "column": 13 } } }, "init": { "type": "CallExpression", "callee": { "type": "Identifier", "name": "cold", "range": [ 446, 450 ], "loc": { "start": { "line": 12, "column": 16 }, "end": { "line": 12, "column": 20 } } }, "arguments": [ { "type": "Literal", "value": "--1--2--3--|", "raw": "'--1--2--3--|'", "range": [ 451, 465 ], "loc": { "start": { "line": 12, "column": 21 }, "end": { "line": 12, "column": 35 } } } ], "range": [ 446, 466 ], "loc": { "start": { "line": 12, "column": 16 }, "end": { "line": 12, "column": 36 } } }, "range": [ 442, 466 ], "loc": { "start": { "line": 12, "column": 12 }, "end": { "line": 12, "column": 36 } } } ], "kind": "var", "range": [ 438, 467 ], "loc": { "start": { "line": 12, "column": 8 }, "end": { "line": 12, "column": 37 } } }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "asubs", "range": [ 480, 485 ], "loc": { "start": { "line": 13, "column": 12 }, "end": { "line": 13, "column": 17 } } }, "init": { "type": "Literal", "value": "^ !", "raw": "'^ !'", "range": [ 488, 502 ], "loc": { "start": { "line": 13, "column": 20 }, "end": { "line": 13, "column": 34 } } }, "range": [ 480, 502 ], "loc": { "start": { "line": 13, "column": 12 }, "end": { "line": 13, "column": 34 } } } ], "kind": "var", "range": [ 476, 503 ], "loc": { "start": { "line": 13, "column": 8 }, "end": { "line": 13, "column": 35 } } }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "expected", "range": [ 516, 524 ], "loc": { "start": { "line": 14, "column": 12 }, "end": { "line": 14, "column": 20 } } }, "init": { "type": "Literal", "value": "--x--y--z--|", "raw": "'--x--y--z--|'", "range": [ 527, 541 ], "loc": { "start": { "line": 14, "column": 23 }, "end": { "line": 14, "column": 37 } } }, "range": [ 516, 541 ], "loc": { "start": { "line": 14, "column": 12 }, "end": { "line": 14, "column": 37 } } } ], "kind": "var", "range": [ 512, 542 ], "loc": { "start": { "line": 14, "column": 8 }, "end": { "line": 14, "column": 38 } } }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "r", "range": [ 555, 556 ], "loc": { "start": { "line": 15, "column": 12 }, "end": { "line": 15, "column": 13 } } }, "init": { "type": "CallExpression", "callee": { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "a", "range": [ 559, 560 ], "loc": { "start": { "line": 15, "column": 16 }, "end": { "line": 15, "column": 17 } } }, "property": { "type": "Identifier", "name": "map", "range": [ 561, 564 ], "loc": { "start": { "line": 15, "column": 18 }, "end": { "line": 15, "column": 21 } } }, "range": [ 559, 564 ], "loc": { "start": { "line": 15, "column": 16 }, "end": { "line": 15, "column": 21 } } }, "arguments": [ { "type": "FunctionExpression", "id": null, "params": [ { "type": "Identifier", "name": "x", "range": [ 575, 576 ], "loc": { "start": { "line": 15, "column": 32 }, "end": { "line": 15, "column": 33 } } } ], "body": { "type": "BlockStatement", "body": [ { "type": "ReturnStatement", "argument": { "type": "BinaryExpression", "operator": "*", "left": { "type": "Literal", "value": 10, "raw": "10", "range": [ 587, 589 ], "loc": { "start": { "line": 15, "column": 44 }, "end": { "line": 15, "column": 46 } } }, "right": { "type": "Identifier", "name": "x", "range": [ 592, 593 ], "loc": { "start": { "line": 15, "column": 49 }, "end": { "line": 15, "column": 50 } } }, "range": [ 587, 593 ], "loc": { "start": { "line": 15, "column": 44 }, "end": { "line": 15, "column": 50 } } }, "range": [ 580, 594 ], "loc": { "start": { "line": 15, "column": 37 }, "end": { "line": 15, "column": 51 } } } ], "range": [ 578, 596 ], "loc": { "start": { "line": 15, "column": 35 }, "end": { "line": 15, "column": 53 } } }, "generator": false, "expression": false, "range": [ 565, 596 ], "loc": { "start": { "line": 15, "column": 22 }, "end": { "line": 15, "column": 53 } } } ], "range": [ 559, 597 ], "loc": { "start": { "line": 15, "column": 16 }, "end": { "line": 15, "column": 54 } } }, "range": [ 555, 597 ], "loc": { "start": { "line": 15, "column": 12 }, "end": { "line": 15, "column": 54 } } } ], "kind": "var", "range": [ 551, 598 ], "loc": { "start": { "line": 15, "column": 8 }, "end": { "line": 15, "column": 55 } } }, { "type": "ExpressionStatement", "expression": {