UNPKG

@reactivex/rxjs

Version:

Reactive Extensions for modern JavaScript

1,196 lines (1,195 loc) 640 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 {from} ", "range": [ 115, 134 ], "loc": { "start": { "line": 5, "column": 0 }, "end": { "line": 5, "column": 19 } } } ] }, { "type": "ExpressionStatement", "expression": { "type": "CallExpression", "callee": { "type": "Identifier", "name": "describe", "range": [ 135, 143 ], "loc": { "start": { "line": 6, "column": 0 }, "end": { "line": 6, "column": 8 } } }, "arguments": [ { "type": "Literal", "value": "Observable.from", "raw": "'Observable.from'", "range": [ 144, 161 ], "loc": { "start": { "line": 6, "column": 9 }, "end": { "line": 6, "column": 26 } } }, { "type": "FunctionExpression", "id": null, "params": [], "body": { "type": "BlockStatement", "body": [ { "type": "ExpressionStatement", "expression": { "type": "CallExpression", "callee": { "type": "CallExpression", "callee": { "type": "Identifier", "name": "asDiagram", "range": [ 181, 190 ], "loc": { "start": { "line": 7, "column": 4 }, "end": { "line": 7, "column": 13 } } }, "arguments": [ { "type": "Literal", "value": "from([10, 20, 30])", "raw": "'from([10, 20, 30])'", "range": [ 191, 211 ], "loc": { "start": { "line": 7, "column": 14 }, "end": { "line": 7, "column": 34 } } } ], "range": [ 181, 212 ], "loc": { "start": { "line": 7, "column": 4 }, "end": { "line": 7, "column": 35 } } }, "arguments": [ { "type": "Literal", "value": "should create an observable from an array", "raw": "'should create an observable from an array'", "range": [ 213, 256 ], "loc": { "start": { "line": 7, "column": 36 }, "end": { "line": 7, "column": 79 } } }, { "type": "FunctionExpression", "id": null, "params": [], "body": { "type": "BlockStatement", "body": [ { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "e1", "range": [ 284, 286 ], "loc": { "start": { "line": 8, "column": 12 }, "end": { "line": 8, "column": 14 } } }, "init": { "type": "CallExpression", "callee": { "type": "MemberExpression", "computed": false, "object": { "type": "CallExpression", "callee": { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "Observable", "range": [ 289, 299 ], "loc": { "start": { "line": 8, "column": 17 }, "end": { "line": 8, "column": 27 } } }, "property": { "type": "Identifier", "name": "from", "range": [ 300, 304 ], "loc": { "start": { "line": 8, "column": 28 }, "end": { "line": 8, "column": 32 } } }, "range": [ 289, 304 ], "loc": { "start": { "line": 8, "column": 17 }, "end": { "line": 8, "column": 32 } } }, "arguments": [ { "type": "ArrayExpression", "elements": [ { "type": "Literal", "value": 10, "raw": "10", "range": [ 306, 308 ], "loc": { "start": { "line": 8, "column": 34 }, "end": { "line": 8, "column": 36 } } }, { "type": "Literal", "value": 20, "raw": "20", "range": [ 310, 312 ], "loc": { "start": { "line": 8, "column": 38 }, "end": { "line": 8, "column": 40 } } }, { "type": "Literal", "value": 30, "raw": "30", "range": [ 314, 316 ], "loc": { "start": { "line": 8, "column": 42 }, "end": { "line": 8, "column": 44 } } } ], "range": [ 305, 317 ], "loc": { "start": { "line": 8, "column": 33 }, "end": { "line": 8, "column": 45 } } } ], "range": [ 289, 318 ], "loc": { "start": { "line": 8, "column": 17 }, "end": { "line": 8, "column": 46 } } }, "property": { "type": "Identifier", "name": "concatMap", "range": [ 332, 341 ], "loc": { "start": { "line": 9, "column": 13 }, "end": { "line": 9, "column": 22 } } }, "range": [ 289, 341 ], "loc": { "start": { "line": 8, "column": 17 }, "end": { "line": 9, "column": 22 } } }, "arguments": [ { "type": "FunctionExpression", "id": null, "params": [ { "type": "Identifier", "name": "x", "range": [ 352, 353 ], "loc": { "start": { "line": 9, "column": 33 }, "end": { "line": 9, "column": 34 } } }, { "type": "Identifier", "name": "i", "range": [ 355, 356 ], "loc": { "start": { "line": 9, "column": 36 }, "end": { "line": 9, "column": 37 } } } ], "body": { "type": "BlockStatement", "body": [ { "type": "ReturnStatement", "argument": { "type": "CallExpression", "callee": { "type": "MemberExpression", "computed": false, "object": { "type": "CallExpression", "callee": { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "Observable", "range": [ 367, 377 ], "loc": { "start": { "line": 9, "column": 48 }, "end": { "line": 9, "column": 58 } } }, "property": { "type": "Identifier", "name": "of", "range": [ 378, 380 ], "loc": { "start": { "line": 9, "column": 59 }, "end": { "line": 9, "column": 61 } } }, "range": [ 367, 380 ], "loc": { "start": { "line": 9, "column": 48 }, "end": { "line": 9, "column": 61 } } }, "arguments": [ { "type": "Identifier", "name": "x", "range": [ 381, 382 ], "loc": { "start": { "line": 9, "column": 62 }, "end": { "line": 9, "column": 63 } } } ], "range": [ 367, 383 ], "loc": { "start": { "line": 9, "column": 48 }, "end": { "line": 9, "column": 64 } } }, "property": { "type": "Identifier", "name": "delay", "range": [ 384, 389 ], "loc": { "start": { "line": 9, "column": 65 }, "end": { "line": 9, "column": 70 } } }, "range": [ 367, 389 ], "loc": { "start": { "line": 9, "column": 48 }, "end": { "line": 9, "column": 70 } } }, "arguments": [ { "type": "ConditionalExpression", "test": { "type": "BinaryExpression", "operator": "===", "left": { "type": "Identifier", "name": "i", "range": [ 390, 391 ], "loc": { "start": { "line": 9, "column": 71 }, "end": { "line": 9, "column": 72 } } }, "right": { "type": "Literal", "value": 0, "raw": "0", "range": [ 396, 397 ], "loc": { "start": { "line": 9, "column": 77 }, "end": { "line": 9, "column": 78 } } }, "range": [ 390, 397 ], "loc": { "start": { "line": 9, "column": 71 }, "end": { "line": 9, "column": 78 } } }, "consequent": { "type": "Literal", "value": 0, "raw": "0", "range": [ 400, 401 ], "loc": { "start": { "line": 9, "column": 81 }, "end": { "line": 9, "column": 82 } } }, "alternate": { "type": "Literal", "value": 20, "raw": "20", "range": [ 404, 406 ], "loc": { "start": { "line": 9, "column": 85 }, "end": { "line": 9, "column": 87 } } }, "range": [ 390, 406 ], "loc": { "start": { "line": 9, "column": 71 }, "end": { "line": 9, "column": 87 } } }, { "type": "Identifier", "name": "rxTestScheduler", "range": [ 408, 423 ], "loc": { "start": { "line": 9, "column": 89 }, "end": { "line": 9, "column": 104 } } } ], "range": [ 367, 424 ], "loc": { "start": { "line": 9, "column": 48 }, "end": { "line": 9, "column": 105 } } }, "range": [ 360, 425 ], "loc": { "start": { "line": 9, "column": 41 }, "end": { "line": 9, "column": 106 } } } ], "range": [ 358, 427 ], "loc": { "start": { "line": 9, "column": 39 }, "end": { "line": 9, "column": 108 } } }, "generator": false, "expression": false, "range": [ 342, 427 ], "loc": { "start": { "line": 9, "column": 23 }, "end": { "line": 9, "column": 108 } } } ], "range": [ 289, 428 ], "loc": { "start": { "line": 8, "column": 17 }, "end": { "line": 9, "column": 109 } } }, "range": [ 284, 428 ], "loc": { "start": { "line": 8, "column": 12 }, "end": { "line": 9, "column": 109 } } } ], "kind": "var", "range": [ 280, 429 ], "loc": { "start": { "line": 8, "column": 8 }, "end": { "line": 9, "column": 110 } } }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "expected", "range": [ 442, 450 ], "loc": { "start": { "line": 10, "column": 12 }, "end": { "line": 10, "column": 20 } } }, "init": { "type": "Literal", "value": "x-y-(z|)", "raw": "'x-y-(z|)'", "range": [ 453, 463 ], "loc": { "start": { "line": 10, "column": 23 }, "end": { "line": 10, "column": 33 } } },