UNPKG

@reactivex/rxjs

Version:

Reactive Extensions for modern JavaScript

1,270 lines 544 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": "Rx", "range": [ 18, 20 ], "loc": { "start": { "line": 2, "column": 4 }, "end": { "line": 2, "column": 6 } } }, "init": { "type": "CallExpression", "callee": { "type": "Identifier", "name": "require", "range": [ 23, 30 ], "loc": { "start": { "line": 2, "column": 9 }, "end": { "line": 2, "column": 16 } } }, "arguments": [ { "type": "Literal", "value": "../../dist/cjs/Rx", "raw": "'../../dist/cjs/Rx'", "range": [ 31, 50 ], "loc": { "start": { "line": 2, "column": 17 }, "end": { "line": 2, "column": 36 } } } ], "range": [ 23, 51 ], "loc": { "start": { "line": 2, "column": 9 }, "end": { "line": 2, "column": 37 } } }, "range": [ 18, 51 ], "loc": { "start": { "line": 2, "column": 4 }, "end": { "line": 2, "column": 37 } } } ], "kind": "var", "range": [ 14, 52 ], "loc": { "start": { "line": 2, "column": 0 }, "end": { "line": 2, "column": 38 } } }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "Observable", "range": [ 57, 67 ], "loc": { "start": { "line": 3, "column": 4 }, "end": { "line": 3, "column": 14 } } }, "init": { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "Rx", "range": [ 70, 72 ], "loc": { "start": { "line": 3, "column": 17 }, "end": { "line": 3, "column": 19 } } }, "property": { "type": "Identifier", "name": "Observable", "range": [ 73, 83 ], "loc": { "start": { "line": 3, "column": 20 }, "end": { "line": 3, "column": 30 } } }, "range": [ 70, 83 ], "loc": { "start": { "line": 3, "column": 17 }, "end": { "line": 3, "column": 30 } } }, "range": [ 57, 83 ], "loc": { "start": { "line": 3, "column": 4 }, "end": { "line": 3, "column": 30 } } } ], "kind": "var", "range": [ 53, 84 ], "loc": { "start": { "line": 3, "column": 0 }, "end": { "line": 3, "column": 31 } } }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "Notification", "range": [ 89, 101 ], "loc": { "start": { "line": 4, "column": 4 }, "end": { "line": 4, "column": 16 } } }, "init": { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "Rx", "range": [ 104, 106 ], "loc": { "start": { "line": 4, "column": 19 }, "end": { "line": 4, "column": 21 } } }, "property": { "type": "Identifier", "name": "Notification", "range": [ 107, 119 ], "loc": { "start": { "line": 4, "column": 22 }, "end": { "line": 4, "column": 34 } } }, "range": [ 104, 119 ], "loc": { "start": { "line": 4, "column": 19 }, "end": { "line": 4, "column": 34 } } }, "range": [ 89, 119 ], "loc": { "start": { "line": 4, "column": 4 }, "end": { "line": 4, "column": 34 } } } ], "kind": "var", "range": [ 85, 120 ], "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 4, "column": 35 } }, "trailingComments": [ { "type": "Block", "value": "* @test {materialize} ", "range": [ 121, 147 ], "loc": { "start": { "line": 5, "column": 0 }, "end": { "line": 5, "column": 26 } } } ] }, { "type": "ExpressionStatement", "expression": { "type": "CallExpression", "callee": { "type": "Identifier", "name": "describe", "range": [ 148, 156 ], "loc": { "start": { "line": 6, "column": 0 }, "end": { "line": 6, "column": 8 } } }, "arguments": [ { "type": "Literal", "value": "Observable.prototype.materialize", "raw": "'Observable.prototype.materialize'", "range": [ 157, 191 ], "loc": { "start": { "line": 6, "column": 9 }, "end": { "line": 6, "column": 43 } } }, { "type": "FunctionExpression", "id": null, "params": [], "body": { "type": "BlockStatement", "body": [ { "type": "ExpressionStatement", "expression": { "type": "CallExpression", "callee": { "type": "CallExpression", "callee": { "type": "Identifier", "name": "asDiagram", "range": [ 211, 220 ], "loc": { "start": { "line": 7, "column": 4 }, "end": { "line": 7, "column": 13 } } }, "arguments": [ { "type": "Literal", "value": "materialize", "raw": "'materialize'", "range": [ 221, 234 ], "loc": { "start": { "line": 7, "column": 14 }, "end": { "line": 7, "column": 27 } } } ], "range": [ 211, 235 ], "loc": { "start": { "line": 7, "column": 4 }, "end": { "line": 7, "column": 28 } } }, "arguments": [ { "type": "Literal", "value": "should materialize an Observable", "raw": "'should materialize an Observable'", "range": [ 236, 270 ], "loc": { "start": { "line": 7, "column": 29 }, "end": { "line": 7, "column": 63 } } }, { "type": "FunctionExpression", "id": null, "params": [], "body": { "type": "BlockStatement", "body": [ { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "e1", "range": [ 298, 300 ], "loc": { "start": { "line": 8, "column": 12 }, "end": { "line": 8, "column": 14 } } }, "init": { "type": "CallExpression", "callee": { "type": "Identifier", "name": "hot", "range": [ 303, 306 ], "loc": { "start": { "line": 8, "column": 17 }, "end": { "line": 8, "column": 20 } } }, "arguments": [ { "type": "Literal", "value": "--x--y--z--|", "raw": "'--x--y--z--|'", "range": [ 307, 321 ], "loc": { "start": { "line": 8, "column": 21 }, "end": { "line": 8, "column": 35 } } } ], "range": [ 303, 322 ], "loc": { "start": { "line": 8, "column": 17 }, "end": { "line": 8, "column": 36 } } }, "range": [ 298, 322 ], "loc": { "start": { "line": 8, "column": 12 }, "end": { "line": 8, "column": 36 } } } ], "kind": "var", "range": [ 294, 323 ], "loc": { "start": { "line": 8, "column": 8 }, "end": { "line": 8, "column": 37 } } }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "expected", "range": [ 336, 344 ], "loc": { "start": { "line": 9, "column": 12 }, "end": { "line": 9, "column": 20 } } }, "init": { "type": "Literal", "value": "--a--b--c--(d|)", "raw": "'--a--b--c--(d|)'", "range": [ 347, 364 ], "loc": { "start": { "line": 9, "column": 23 }, "end": { "line": 9, "column": 40 } } }, "range": [ 336, 364 ], "loc": { "start": { "line": 9, "column": 12 }, "end": { "line": 9, "column": 40 } } } ], "kind": "var", "range": [ 332, 365 ], "loc": { "start": { "line": 9, "column": 8 }, "end": { "line": 9, "column": 41 } } }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "values", "range": [ 378, 384 ], "loc": { "start": { "line": 10, "column": 12 }, "end": { "line": 10, "column": 18 } } }, "init": { "type": "ObjectExpression", "properties": [ { "type": "Property", "key": { "type": "Identifier", "name": "a", "range": [ 389, 390 ], "loc": { "start": { "line": 10, "column": 23 }, "end": { "line": 10, "column": 24 } } }, "value": { "type": "Literal", "value": "{x}", "raw": "'{x}'", "range": [ 392, 397 ], "loc": { "start": { "line": 10, "column": 26 }, "end": { "line": 10, "column": 31 } } }, "kind": "init", "method": false, "shorthand": false, "computed": false, "range": [ 389, 397 ], "loc": { "start": { "line": 10, "column": 23 }, "end": { "line": 10, "column": 31 } } }, { "type": "Property", "key": { "type": "Identifier", "name": "b", "range": [ 399, 400 ], "loc": { "start": { "line": 10, "column": 33 }, "end": { "line": 10, "column": 34 } } }, "value": { "type": "Literal", "value": "{y}", "raw": "'{y}'", "range": [ 402, 407 ], "loc": { "start": { "line": 10, "column": 36 }, "end": { "line": 10, "column": 41 } } }, "kind": "init", "method": false, "shorthand": false, "computed": false, "range": [ 399, 407 ], "loc": { "start": { "line": 10, "column": 33 }, "end": { "line": 10, "column": 41 } } }, { "type": "Property", "key": { "type": "Identifier", "name": "c", "range": [ 409, 410 ], "loc": { "start": { "line": 10, "column": 43 }, "end": { "line": 10, "column": 44 } } }, "value": { "type": "Literal", "value": "{z}", "raw": "'{z}'", "range": [ 412, 417 ], "loc": { "start": { "line": 10, "column": 46 }, "end": { "line": 10, "column": 51 } } }, "kind": "init", "method": false, "shorthand": false, "computed": false, "range": [ 409, 417 ], "loc": { "start": { "line": 10, "column": 43 }, "end": { "line": 10, "column": 51 } } }, { "type": "Property", "key": { "type": "Identifier", "name": "d", "range": [ 419, 420 ], "loc": { "start": { "line": 10, "column": 53 }, "end": { "line": 10, "column": 54 } } }, "value": { "type": "Literal", "value": "|", "raw": "'|'", "range": [ 422, 425 ], "loc": { "start": { "line": 10, "column": 56 }, "end": { "line": 10, "column": 59 } } }, "kind": "init", "method": false, "shorthand": false, "computed": false, "range": [ 419, 425 ], "loc": { "start": { "line": 10, "column": 53 }, "end": { "line": 10, "column": 59 } } } ], "range": [ 387, 427 ], "loc": { "start": { "line": 10, "column": 21 }, "end": { "line": 10, "column": 61 } } }, "range": [ 378, 427 ], "loc": { "start": { "line": 10, "column": 12 }, "end": { "line": 10, "column": 61 } } } ], "kind": "var", "range": [ 374, 428 ], "loc": { "start": { "line": 10, "column": 8 }, "end": { "line": 10, "column": 62 } } }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "result", "range": [ 441, 447 ], "loc": { "start": { "line": 11, "column": 12 }, "end": { "line": 11, "column": 18 } } }, "init": { "type": "CallExpression", "callee": { "type": "MemberExpression", "computed": false, "object": { "type": "CallExpression", "callee": { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "e1", "range": [ 450, 452 ], "loc": { "start": { "line": 11, "column": 21 }, "end": { "line": 11, "column": 23 } } }, "property": { "type": "Identifier", "name": "materialize", "range": [ 466, 477 ], "loc": { "start": { "line": 12, "column": 13 }, "end": { "line": 12, "column": 24 } } }, "range": [ 450, 477 ], "loc": { "start": { "line": 11, "column": 21 }, "end": { "line": 12, "column": 24 } } }, "arguments": [], "range": [ 450, 479 ], "loc": { "start": { "line": 11, "column": 21 }, "end": { "line": 12, "column": 26 } } }, "property": { "type": "Identifier", "name": "map", "range": [ 493, 496 ], "loc": { "start": { "line": 13, "column": 13 }, "end": { "line": 13, "column": 16 } } }, "range": [ 450, 496 ], "loc": { "start": { "line": 11, "column": 21 }, "end": { "line": 13, "column": 16 } } }, "arguments": [ { "type": "FunctionExpression", "id": null, "params": [ { "type": "Identifier", "name": "x", "range": [ 507, 508 ], "loc": { "start": { "line": 13, "column": 27 }, "end": { "line": 13, "column": 28 } } } ], "body": { "type": "BlockStatement", "body": [ { "type": "IfStatement", "test": { "type": "BinaryExpression", "operator": "===", "left": { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "x", "range": [ 528, 529 ], "loc": { "start": { "line": 14, "column": 16 }, "end": { "line": 14, "column": 17 } } }, "property": { "type": "Identifier", "name": "kind", "range": [ 530, 534 ], "loc": { "start": { "line": 14, "column": 18 }, "end": { "line": 14, "column": 22 } } }, "range": [ 528, 534 ], "loc": { "start": { "line": 14, "column": 16 }, "end": { "line": 14, "column": 22 } } }, "right": { "type": "Literal", "value": "C", "raw": "'C'", "range": [ 539, 542 ], "loc": { "start": { "line": 14, "column": 27 }, "end": { "line": 14, "column": 30 } } }, "range": [ 528, 542 ], "loc": { "start": { "line": 14, "column": 16 }, "end": { "line": 14, "column": 30 } } }, "consequent": { "type": "BlockSta