UNPKG

@reactivex/rxjs

Version:

Reactive Extensions for modern JavaScript

1,871 lines (1,870 loc) 3.17 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": "sinon", "range": [ 48, 53 ], "loc": { "start": { "line": 3, "column": 4 }, "end": { "line": 3, "column": 9 } } }, "init": { "type": "CallExpression", "callee": { "type": "Identifier", "name": "require", "range": [ 56, 63 ], "loc": { "start": { "line": 3, "column": 12 }, "end": { "line": 3, "column": 19 } } }, "arguments": [ { "type": "Literal", "value": "sinon", "raw": "'sinon'", "range": [ 64, 71 ], "loc": { "start": { "line": 3, "column": 20 }, "end": { "line": 3, "column": 27 } } } ], "range": [ 56, 72 ], "loc": { "start": { "line": 3, "column": 12 }, "end": { "line": 3, "column": 28 } } }, "range": [ 48, 72 ], "loc": { "start": { "line": 3, "column": 4 }, "end": { "line": 3, "column": 28 } } } ], "kind": "var", "range": [ 44, 73 ], "loc": { "start": { "line": 3, "column": 0 }, "end": { "line": 3, "column": 29 } } }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "Rx", "range": [ 78, 80 ], "loc": { "start": { "line": 4, "column": 4 }, "end": { "line": 4, "column": 6 } } }, "init": { "type": "CallExpression", "callee": { "type": "Identifier", "name": "require", "range": [ 83, 90 ], "loc": { "start": { "line": 4, "column": 9 }, "end": { "line": 4, "column": 16 } } }, "arguments": [ { "type": "Literal", "value": "../../../dist/cjs/Rx", "raw": "'../../../dist/cjs/Rx'", "range": [ 91, 113 ], "loc": { "start": { "line": 4, "column": 17 }, "end": { "line": 4, "column": 39 } } } ], "range": [ 83, 114 ], "loc": { "start": { "line": 4, "column": 9 }, "end": { "line": 4, "column": 40 } } }, "range": [ 78, 114 ], "loc": { "start": { "line": 4, "column": 4 }, "end": { "line": 4, "column": 40 } } } ], "kind": "var", "range": [ 74, 115 ], "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 4, "column": 41 } } }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "ajax_helper_1", "range": [ 120, 133 ], "loc": { "start": { "line": 5, "column": 4 }, "end": { "line": 5, "column": 17 } } }, "init": { "type": "CallExpression", "callee": { "type": "Identifier", "name": "require", "range": [ 136, 143 ], "loc": { "start": { "line": 5, "column": 20 }, "end": { "line": 5, "column": 27 } } }, "arguments": [ { "type": "Literal", "value": "../../helpers/ajax-helper", "raw": "'../../helpers/ajax-helper'", "range": [ 144, 171 ], "loc": { "start": { "line": 5, "column": 28 }, "end": { "line": 5, "column": 55 } } } ], "range": [ 136, 172 ], "loc": { "start": { "line": 5, "column": 20 }, "end": { "line": 5, "column": 56 } } }, "range": [ 120, 172 ], "loc": { "start": { "line": 5, "column": 4 }, "end": { "line": 5, "column": 56 } } } ], "kind": "var", "range": [ 116, 173 ], "loc": { "start": { "line": 5, "column": 0 }, "end": { "line": 5, "column": 57 } } }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "Observable", "range": [ 178, 188 ], "loc": { "start": { "line": 6, "column": 4 }, "end": { "line": 6, "column": 14 } } }, "init": { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "Rx", "range": [ 191, 193 ], "loc": { "start": { "line": 6, "column": 17 }, "end": { "line": 6, "column": 19 } } }, "property": { "type": "Identifier", "name": "Observable", "range": [ 194, 204 ], "loc": { "start": { "line": 6, "column": 20 }, "end": { "line": 6, "column": 30 } } }, "range": [ 191, 204 ], "loc": { "start": { "line": 6, "column": 17 }, "end": { "line": 6, "column": 30 } } }, "range": [ 178, 204 ], "loc": { "start": { "line": 6, "column": 4 }, "end": { "line": 6, "column": 30 } } } ], "kind": "var", "range": [ 174, 205 ], "loc": { "start": { "line": 6, "column": 0 }, "end": { "line": 6, "column": 31 } } }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "__ws", "range": [ 210, 214 ], "loc": { "start": { "line": 7, "column": 4 }, "end": { "line": 7, "column": 8 } } }, "init": null, "range": [ 210, 214 ], "loc": { "start": { "line": 7, "column": 4 }, "end": { "line": 7, "column": 8 } } } ], "kind": "var", "range": [ 206, 215 ], "loc": { "start": { "line": 7, "column": 0 }, "end": { "line": 7, "column": 9 } } }, { "type": "FunctionDeclaration", "id": { "type": "Identifier", "name": "setupMockWebSocket", "range": [ 225, 243 ], "loc": { "start": { "line": 8, "column": 9 }, "end": { "line": 8, "column": 27 } } }, "params": [], "body": { "type": "BlockStatement", "body": [ { "type": "ExpressionStatement", "expression": { "type": "CallExpression", "callee": { "type": "MemberExpression", "computed": false, "object": { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "ajax_helper_1", "range": [ 252, 265 ], "loc": { "start": { "line": 9, "column": 4 }, "end": { "line": 9, "column": 17 } } }, "property": { "type": "Identifier", "name": "MockWebSocket", "range": [ 266, 279 ], "loc": { "start": { "line": 9, "column": 18 }, "end": { "line": 9, "column": 31 } } }, "range": [ 252, 279 ], "loc": { "start": { "line": 9, "column": 4 }, "end": { "line": 9, "column": 31 } } }, "property": { "type": "Identifier", "name": "clearSockets", "range": [ 280, 292 ], "loc": { "start": { "line": 9, "column": 32 }, "end": { "line": 9, "column": 44 } } }, "range": [ 252, 292 ], "loc": { "start": { "line": 9, "column": 4 }, "end": { "line": 9, "column": 44 } } }, "arguments": [], "range": [ 252, 294 ], "loc": { "start": { "line": 9, "column": 4 }, "end": { "line": 9, "column": 46 } } }, "range": [ 252, 295 ], "loc": { "start": { "line": 9, "column": 4 }, "end": { "line": 9, "column": 47 } } }, { "type": "ExpressionStatement", "expression": { "type": "AssignmentExpression", "operator": "=", "left": { "type": "Identifier", "name": "__ws", "range": [ 300, 304 ], "loc": { "start": { "line": 10, "column": 4 }, "end": { "line": 10, "column": 8 } } }, "right": { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "__root__", "range": [ 307, 315 ], "loc": { "start": { "line": 10, "column": 11 }, "end": { "line": 10, "column": 19 } } }, "property": { "type": "Identifier", "name": "WebSocket", "range": [ 316, 325 ], "loc": { "start": { "line": 10, "column": 20 }, "end": { "line": 10, "column": 29 } } }, "range": [ 307, 325 ], "loc": { "start": { "line": 10, "column": 11 }, "end": { "line": 10, "column": 29 } } }, "range": [ 300, 325 ], "loc": { "start": { "line": 10, "column": 4 }, "end": { "line": 10, "column": 29 } } }, "range": [ 300, 326 ], "loc": { "start": { "line": 10, "column": 4 }, "end": { "line": 10, "column": 30 } } }, { "type": "ExpressionStatement", "expression": { "type": "AssignmentExpression", "operator": "=", "left": { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "__root__", "range": [ 331, 339 ], "loc": { "start": { "line": 11, "column": 4 }, "end": { "line": 11, "column": 12 } } }, "property": { "type": "Identifier", "name": "WebSocket", "range": [ 340, 349 ], "loc": { "start": { "line": 11, "column": 13 }, "end": { "line": 11, "column": 22 } } }, "range": [ 331, 349 ], "loc": { "start": { "line": 11, "column": 4 }, "end": { "line": 11, "column": 22 } } }, "right": { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "ajax_helper_1", "range": [ 352, 365 ], "loc": { "start": { "line": 11, "column": 25 }, "end": { "line": 11, "column": 38 } } }, "property": { "type": "Identifier", "name": "MockWebSocket", "range": [ 366, 379 ], "loc": { "start": { "line": 11, "column": 39 }, "end": { "line": 11, "column": 52 } } }, "range": [ 352, 379 ], "loc": { "start": { "line": 11, "column": 25 }, "end": { "line": 11, "column": 52 } } }, "range": [ 331, 379 ], "loc": { "start": { "line": 11, "column": 4 }, "end": { "line": 11, "column": 52 } } }, "range": [ 331, 380 ], "loc": { "start": { "line": 11, "column": 4 }, "end": { "line": 11, "column": 53 } } } ], "range": [ 246, 382 ], "loc": { "start": { "line": 8, "column": 30 }, "end": { "line": 12, "column": 1 } } }, "generator": false, "expression": false, "range": [ 216, 382 ], "loc": { "start": { "line": 8, "column": 0 }, "end": { "line": 12, "column": 1 } } }, { "type": "FunctionDeclaration", "id": { "type": "Identifier", "name": "teardownMockWebSocket", "range": [ 392, 413 ], "loc": { "start": { "line": 13, "column": 9 }, "end": { "line": 13, "column": 30 } } }, "params": [], "body": { "type": "BlockStatement", "body": [ { "type": "ExpressionStatement", "expression": { "type": "AssignmentExpression", "operator": "=", "left": { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "__root__", "range": [ 422, 430 ], "loc": { "start": { "line": 14, "column": 4 }, "end": { "line": 14, "column": 12 } } }, "property": { "type": "Identifier", "name": "WebSocket", "range": [ 431, 440 ], "loc": { "start": { "line": 14, "column": 13 }, "end": { "line": 14, "column": 22 } } }, "range": [ 422, 440 ], "loc": { "start": { "line": 14, "column": 4 }, "end": { "line": 14, "column": 22 } } }, "right": { "type": "Identifier", "name": "__ws", "range": [ 443, 447 ], "loc": { "start": { "line": 14, "column": 25 }, "end": { "line": 14, "column": 29 } } }, "range": [ 422, 447 ], "loc": { "start": { "line": 14, "column": 4 }, "end": { "line": 14, "column": 29 } } }, "range": [ 422, 448 ], "loc": { "start": { "line": 14, "column": 4 }, "end": { "line": 14, "column": 30 } } }, { "type": "ExpressionStatement", "expression": { "type": "CallExpression", "callee": { "type": "MemberExpression", "computed": false, "object": { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "ajax_helper_1", "range": [ 453, 466 ], "loc": { "start": { "line": 15, "column": 4 }, "end": { "line": 15, "column": 17 } } }, "property": { "type": "Identifier", "name": "MockWebSocket", "range": [ 467, 480 ], "loc": { "start": { "line": 15, "column": 18 }, "end": { "line": 15, "column": 31 } } }, "range": [ 453, 480 ], "loc": { "start": { "line": 15, "column": 4 }, "end": { "line": 15, "column": 31 } } }, "property": { "type": "Identifier", "name": "clearSockets", "range": [ 481, 493 ], "loc": { "start": { "line": 15, "column": 32 }, "end": { "line": 15, "column": 44 } } }, "range": [ 453, 493 ], "loc": { "start": { "line": 15, "column": 4 }, "end": { "line": 15, "column": 44 } } }, "arguments": [], "range": [ 453, 495 ], "loc": { "start": { "line": 15, "column": 4 }, "end": { "line": 15, "column": 46 } } }, "range": [ 453, 496 ], "loc": { "start": { "line": 15, "column": 4 }, "end": { "line": 15, "column": 47 } } } ], "range": [ 416, 498 ], "loc": { "start": { "line": 13, "column": 33 }, "end": { "line": 16, "column": 1 } } }, "generator": false, "expression": false, "range": [ 383, 498 ], "loc": { "start": { "line": 13, "column": 0 }, "end": { "line": 16, "column": 1 } }, "trailingComments": [ { "type": "Block", "value": "* @test {webSocket} ", "range": [ 499, 523 ], "loc": { "start": { "line": 17, "column": 0 }, "end": { "line": 17, "column": 24 } } } ] }, { "type": "ExpressionStatement", "expression": { "type": "CallExpression", "callee": { "type": "Identifier", "name": "describe", "range": [ 524, 532 ], "loc": { "start": { "line": 18, "column": 0 }, "end": { "line": 18, "column": 8 } } }, "arguments": [ { "type": "Literal", "value": "Observable.webSocket", "raw": "'Observable.webSocket'", "range": [ 533, 555 ], "loc": { "start": { "line": 18, "column": 9 }, "end": { "line": 18, "column": 31 } } }, { "type": "FunctionExpression", "id": null, "params": [], "body": { "type": "BlockStatement", "body": [ { "type": "ExpressionStatement", "expression": { "type": "CallExpression", "callee": { "type": "Identifier", "name": "beforeEach", "range": [ 575, 585 ], "loc": { "start": { "line": 19, "column": 4 }, "end": { "line": 19, "column": 14 } } }, "arguments": [ { "type": "FunctionExpression", "id": null, "params": [], "body": { "type": "BlockStatement", "body": [ { "type": "ExpressionStatement", "expression": { "type": "CallExpression", "callee": { "type": "Identifier", "name": "setupMockWebSocket", "range": [ 608, 626 ], "loc": { "start": { "line": 20, "column": 8 }, "end": { "line": 20, "column": 26 } } }, "arguments": [], "range": [ 608, 628 ], "loc": { "start": { "line": 20, "column": 8 }, "end": { "line": 20, "column": 28 } } }, "range": [ 608, 629 ], "loc": { "start": { "line": 20, "column": 8 }, "end": { "line": 20, "column": 29 } } } ], "range": [ 598, 635 ], "loc": { "start": { "line": 19, "column": 27 }, "end": { "line": 21, "column": 5 } } }, "generator": false, "expression": false, "range": [ 586, 635 ], "loc": { "start": { "line": 19, "column": 15 }, "end": { "line": 21, "column": 5 } } } ], "range": [ 575, 636 ], "loc": { "start": { "line": 19, "column": 4 }, "end": { "line": 21, "column": 6 } } }, "range": [ 575, 637 ], "loc": { "start": { "line": 19, "column": 4 }, "end": { "line": 21, "column": 7 } } }, { "type": "ExpressionStatement", "expression": { "type": "CallExpression", "callee": { "type": "Identifier", "name": "afterEach", "range": [ 642, 651 ], "loc": { "start": { "line": 22, "column": 4 }, "end": { "line": 22, "column": 13 } } }, "arguments": [ { "type": "FunctionExpression", "id": null, "params": [], "body": { "type": "BlockStatement", "body": [ { "type": "ExpressionStatement", "expression": { "type": "CallExpression", "callee": { "type": "Identifier", "name": "teardownMockWebSocket", "range": [ 674, 695 ], "loc": { "start": { "line": 23, "column": 8 }, "end": { "line": 23, "column": 29 } } }, "arguments": [], "range": [ 674, 697 ], "loc": { "start": { "line": 23, "column": 8 }, "end": { "line": 23, "column": 31 } } }, "range": [ 674, 698 ], "loc": { "start": { "line": 23, "column": 8 }, "end": { "line": 23, "column": 32 } } } ], "range": [ 664, 704 ], "loc": { "start": { "line": 22, "column": 26 }, "end": { "line": 24, "column": 5 } } }, "generator": false, "expression": false, "range": [ 652, 704 ], "loc": { "start": { "line": 22, "column": 14 }, "end": { "line": 24, "column": 5 } } } ], "range": [ 642, 705 ], "loc": { "start": { "line": 22, "column": 4 }, "end": { "line": 24, "column": 6 } } }, "range": [ 642, 706 ], "loc": { "start": { "line": 22, "column": 4 }, "end": { "line": 24, "column": 7 } } }, { "type": "ExpressionStatement", "expression": { "type": "CallExpression", "callee": { "type": "Identifier", "name": "it", "range": [ 711, 713 ], "loc": { "start": { "line": 25, "column": 4 }, "end": { "line": 25, "column": 6 } } }, "arguments": [ { "type": "Literal", "value": "should send and receive messages", "raw": "'should send and receive messages'", "range": [ 714, 748 ], "loc": { "start": { "line": 25, "column": 7 }, "end": { "line": 25, "column": 41 } } }, { "type": "FunctionExpression", "id": null, "params": [], "body": { "type": "BlockStatement", "body": [ { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "messageReceived", "range": [ 776, 791 ], "loc": { "start": { "line": 26, "column": 12 }, "end": { "line": 26, "column": 27 } } }, "init": { "type": "Literal", "value": false, "raw": "false", "range": [ 794, 799 ], "loc": { "start": { "line": 26, "column": 30 }, "end": { "line": 26, "column": 35 } } }, "range": [ 776, 799 ], "loc": { "start": { "line": 26, "column": 12 }, "end": { "line": 26, "column": 35 } } } ], "kind": "var", "range": [ 772, 800 ], "loc": { "start": { "line": 26, "column": 8 }, "end": { "line": 26, "column": 36 } } }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "subject", "range": [ 813, 820 ], "loc": { "start": { "line": 27,