UNPKG

@reactivex/rxjs

Version:

Reactive Extensions for modern JavaScript

1,303 lines (1,302 loc) 323 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 } }, "trailingComments": [ { "type": "Block", "value": "* @test {defaultIfEmpty} ", "range": [ 85, 114 ], "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 4, "column": 29 } } } ] }, { "type": "ExpressionStatement", "expression": { "type": "CallExpression", "callee": { "type": "Identifier", "name": "describe", "range": [ 115, 123 ], "loc": { "start": { "line": 5, "column": 0 }, "end": { "line": 5, "column": 8 } } }, "arguments": [ { "type": "Literal", "value": "Observable.prototype.defaultIfEmpty", "raw": "'Observable.prototype.defaultIfEmpty'", "range": [ 124, 161 ], "loc": { "start": { "line": 5, "column": 9 }, "end": { "line": 5, "column": 46 } } }, { "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": 6, "column": 4 }, "end": { "line": 6, "column": 13 } } }, "arguments": [ { "type": "Literal", "value": "defaultIfEmpty(42)", "raw": "'defaultIfEmpty(42)'", "range": [ 191, 211 ], "loc": { "start": { "line": 6, "column": 14 }, "end": { "line": 6, "column": 34 } } } ], "range": [ 181, 212 ], "loc": { "start": { "line": 6, "column": 4 }, "end": { "line": 6, "column": 35 } } }, "arguments": [ { "type": "Literal", "value": "should return the Observable if not empty with a default value", "raw": "'should return the Observable if not empty with a default value'", "range": [ 213, 277 ], "loc": { "start": { "line": 6, "column": 36 }, "end": { "line": 6, "column": 100 } } }, { "type": "FunctionExpression", "id": null, "params": [], "body": { "type": "BlockStatement", "body": [ { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "e1", "range": [ 305, 307 ], "loc": { "start": { "line": 7, "column": 12 }, "end": { "line": 7, "column": 14 } } }, "init": { "type": "CallExpression", "callee": { "type": "Identifier", "name": "hot", "range": [ 310, 313 ], "loc": { "start": { "line": 7, "column": 17 }, "end": { "line": 7, "column": 20 } } }, "arguments": [ { "type": "Literal", "value": "--------|", "raw": "'--------|'", "range": [ 314, 325 ], "loc": { "start": { "line": 7, "column": 21 }, "end": { "line": 7, "column": 32 } } } ], "range": [ 310, 326 ], "loc": { "start": { "line": 7, "column": 17 }, "end": { "line": 7, "column": 33 } } }, "range": [ 305, 326 ], "loc": { "start": { "line": 7, "column": 12 }, "end": { "line": 7, "column": 33 } } } ], "kind": "var", "range": [ 301, 327 ], "loc": { "start": { "line": 7, "column": 8 }, "end": { "line": 7, "column": 34 } } }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "expected", "range": [ 340, 348 ], "loc": { "start": { "line": 8, "column": 12 }, "end": { "line": 8, "column": 20 } } }, "init": { "type": "Literal", "value": "--------(x|)", "raw": "'--------(x|)'", "range": [ 351, 365 ], "loc": { "start": { "line": 8, "column": 23 }, "end": { "line": 8, "column": 37 } } }, "range": [ 340, 365 ], "loc": { "start": { "line": 8, "column": 12 }, "end": { "line": 8, "column": 37 } } } ], "kind": "var", "range": [ 336, 366 ], "loc": { "start": { "line": 8, "column": 8 }, "end": { "line": 8, "column": 38 } } }, { "type": "ExpressionStatement", "expression": { "type": "CallExpression", "callee": { "type": "MemberExpression", "computed": false, "object": { "type": "CallExpression", "callee": { "type": "Identifier", "name": "expectObservable", "range": [ 375, 391 ], "loc": { "start": { "line": 9, "column": 8 }, "end": { "line": 9, "column": 24 } } }, "arguments": [ { "type": "CallExpression", "callee": { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "e1", "range": [ 392, 394 ], "loc": { "start": { "line": 9, "column": 25 }, "end": { "line": 9, "column": 27 } } }, "property": { "type": "Identifier", "name": "defaultIfEmpty", "range": [ 395, 409 ], "loc": { "start": { "line": 9, "column": 28 }, "end": { "line": 9, "column": 42 } } }, "range": [ 392, 409 ], "loc": { "start": { "line": 9, "column": 25 }, "end": { "line": 9, "column": 42 } } }, "arguments": [ { "type": "Literal", "value": 42, "raw": "42", "range": [ 410, 412 ], "loc": { "start": { "line": 9, "column": 43 }, "end": { "line": 9, "column": 45 } } } ], "range": [ 392, 413 ], "loc": { "start": { "line": 9, "column": 25 }, "end": { "line": 9, "column": 46 } } } ], "range": [ 375, 414 ], "loc": { "start": { "line": 9, "column": 8 }, "end": { "line": 9, "column": 47 } } }, "property": { "type": "Identifier", "name": "toBe", "range": [ 415, 419 ], "loc": { "start": { "line": 9, "column": 48 }, "end": { "line": 9, "column": 52 } } }, "range": [ 375, 419 ], "loc": { "start": { "line": 9, "column": 8 }, "end": { "line": 9, "column": 52 } } }, "arguments": [ { "type": "Identifier", "name": "expected", "range": [ 420, 428 ], "loc": { "start": { "line": 9, "column": 53 }, "end": { "line": 9, "column": 61 } } }, { "type": "ObjectExpression", "properties": [ { "type": "Property", "key": { "type": "Identifier", "name": "x", "range": [ 432, 433 ], "loc": { "start": { "line": 9, "column": 65 }, "end": { "line": 9, "column": 66 } } }, "value": { "type": "Literal", "value": 42, "raw": "42", "range": [ 435, 437 ], "loc": { "start": { "line": 9, "column": 68 }, "end": { "line": 9, "column": 70 } } }, "kind": "init", "method": false, "shorthand": false, "computed": false, "range": [ 432, 437 ], "loc": { "start": { "line": 9, "column": 65 }, "end": { "line": 9, "column": 70 } } } ], "range": [ 430, 439 ], "loc": { "start": { "line": 9, "column": 63 }, "end": { "line": 9, "column": 72 } } } ], "range": [ 375, 440 ], "loc": { "start": { "line": 9, "column": 8 }, "end": { "line": 9, "column": 73 } } }, "range": [ 375, 441 ], "loc": { "start": { "line": 9, "column": 8 }, "end": { "line": 9, "column": 74 } } } ], "range": [ 291, 447 ], "loc": { "start": { "line": 6, "column": 114 }, "end": { "line": 10, "column": 5 } } }, "generator": false, "expression": false, "range": [ 279, 447 ], "loc": { "start": { "line": 6, "column": 102 }, "end": { "line": 10, "column": 5 } } } ], "range": [ 181, 448 ], "loc": { "start": { "line": 6, "column": 4 }, "end": { "line": 10, "column": 6 } } }, "range": [ 181, 449 ], "loc": { "start": { "line": 6, "column": 4 }, "end": { "line": 10, "column": 7 } } }, { "type": "ExpressionStatement", "expression": { "type": "CallExpression", "callee": { "type": "Identifier", "name": "it", "range": [ 454, 456 ], "loc": { "start": { "line": 11, "column": 4 }, "end": { "line": 11, "column": 6 } } }, "arguments": [ { "type": "Literal", "value": "should return the argument if Observable is empty", "raw": "'should return the argument if Observable is empty'", "range": [ 457, 508 ], "loc": { "start": { "line": 11, "column": 7 }, "end": { "line": 11, "column": 58 } } }, { "type": "FunctionExpression", "id": null, "params": [], "body": { "type": "BlockStatement", "body": [ { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "e1", "range": [ 536, 538 ], "loc": { "start": { "line": 12, "column": 12 }, "end": { "line": 12, "column": 14 } } }, "init": { "type": "CallExpression", "callee": { "type": "Identifier", "name": "cold", "range": [ 541, 545 ], "loc": { "start": { "line": 12, "column": 17 }, "end": { "line": 12, "column": 21 } } }, "arguments": [ { "type": "Literal", "value": "|", "raw": "'|'", "range": [ 546, 549 ], "loc": { "start": { "line": 12, "column": 22 }, "end": { "line": 12, "column": 25 } } } ], "range": [ 541, 550 ], "loc": { "start": { "line": 12, "column": 17 }, "end": { "line": 12, "column": 26 } } }, "range": [ 536, 550 ], "loc": { "start": { "line": 12, "column": 12 }, "end": { "line": 12, "column": 26 } } } ], "kind": "var", "range": [ 532, 551 ], "loc": { "start": { "line": 12, "column": 8 }, "end": { "line": 12, "column": 27 } } }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "e1subs", "range": [ 564, 570 ], "loc": { "start": { "line": 13, "column": 12 }, "end": { "line": 13, "column": 18 } } }, "init": { "type": "Literal", "value": "(^!)", "raw": "'(^!)'", "range": [ 573, 579 ], "loc": { "start": { "line": 13, "column": 21 }, "end": { "line": 13, "column": 27 } } }, "range": [ 564, 579 ], "loc": { "start": { "line": 13, "column": 12 }, "end": { "line": 13, "column": 27 } } } ], "kind": "var", "range": [ 560, 580 ], "loc": { "start": { "line": 13, "column": 8 }, "end": { "line": 13, "column": 28 } } }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "expected", "range": [ 593, 601 ], "loc": { "start": { "line": 14, "column": 12 }, "end": { "line": 14, "column": 20 } } }, "init": { "type": "Literal", "value": "(x|)", "raw": "'(x|)'", "range": [ 604, 610 ], "loc": { "start": { "line": 14, "column": 23 }, "end": { "line": 14, "column": 29 } } }, "range": [ 593, 610 ], "loc": { "start": { "line": 14, "column": 12 }, "end": { "line": 14, "column": 29 } } } ], "kind": "var", "range": [ 589, 611 ], "loc": { "start": { "line": 14, "column": 8 }, "end": { "line": 14, "column": 30 } } }, { "type": "ExpressionStatement", "expression": { "type": "CallExpression", "callee": { "type": "MemberExpression", "computed": false, "object": { "type": "CallExpression", "callee": { "type": "Identifier", "name": "expectObservable", "range": [ 620, 636 ], "loc": { "start": { "line": 15, "column": 8 }, "end": { "line": 15, "column": 24 } } }, "arguments": [ { "type": "CallExpression", "callee": { "type": "MemberExpression", "computed": false, "object": {