UNPKG

@reactivex/rxjs

Version:

Reactive Extensions for modern JavaScript

1,067 lines (1,066 loc) 936 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 {fromEvent} ", "range": [ 115, 139 ], "loc": { "start": { "line": 5, "column": 0 }, "end": { "line": 5, "column": 24 } } } ] }, { "type": "ExpressionStatement", "expression": { "type": "CallExpression", "callee": { "type": "Identifier", "name": "describe", "range": [ 140, 148 ], "loc": { "start": { "line": 6, "column": 0 }, "end": { "line": 6, "column": 8 } } }, "arguments": [ { "type": "Literal", "value": "Observable.fromEvent", "raw": "'Observable.fromEvent'", "range": [ 149, 171 ], "loc": { "start": { "line": 6, "column": 9 }, "end": { "line": 6, "column": 31 } } }, { "type": "FunctionExpression", "id": null, "params": [], "body": { "type": "BlockStatement", "body": [ { "type": "ExpressionStatement", "expression": { "type": "CallExpression", "callee": { "type": "CallExpression", "callee": { "type": "Identifier", "name": "asDiagram", "range": [ 191, 200 ], "loc": { "start": { "line": 7, "column": 4 }, "end": { "line": 7, "column": 13 } } }, "arguments": [ { "type": "Literal", "value": "fromEvent(element, 'click')", "raw": "'fromEvent(element, \\'click\\')'", "range": [ 201, 232 ], "loc": { "start": { "line": 7, "column": 14 }, "end": { "line": 7, "column": 45 } } } ], "range": [ 191, 233 ], "loc": { "start": { "line": 7, "column": 4 }, "end": { "line": 7, "column": 46 } } }, "arguments": [ { "type": "Literal", "value": "should create an observable of click on the element", "raw": "'should create an observable of click on the element'", "range": [ 234, 287 ], "loc": { "start": { "line": 7, "column": 47 }, "end": { "line": 7, "column": 100 } } }, { "type": "FunctionExpression", "id": null, "params": [], "body": { "type": "BlockStatement", "body": [ { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "target", "range": [ 315, 321 ], "loc": { "start": { "line": 8, "column": 12 }, "end": { "line": 8, "column": 18 } } }, "init": { "type": "ObjectExpression", "properties": [ { "type": "Property", "key": { "type": "Identifier", "name": "addEventListener", "range": [ 338, 354 ], "loc": { "start": { "line": 9, "column": 12 }, "end": { "line": 9, "column": 28 } } }, "value": { "type": "FunctionExpression", "id": null, "params": [ { "type": "Identifier", "name": "eventType", "range": [ 366, 375 ], "loc": { "start": { "line": 9, "column": 40 }, "end": { "line": 9, "column": 49 } } }, { "type": "Identifier", "name": "listener", "range": [ 377, 385 ], "loc": { "start": { "line": 9, "column": 51 }, "end": { "line": 9, "column": 59 } } } ], "body": { "type": "BlockStatement", "body": [ { "type": "ExpressionStatement", "expression": { "type": "CallExpression", "callee": { "type": "MemberExpression", "computed": false, "object": { "type": "CallExpression", "callee": { "type": "MemberExpression", "computed": false, "object": { "type": "CallExpression", "callee": { "type": "MemberExpression", "computed": false, "object": { "type": "CallExpression", "callee": { "type": "MemberExpression", "computed": false, "object": { "type": "CallExpression", "callee": { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "Observable", "range": [ 405, 415 ], "loc": { "start": { "line": 10, "column": 16 }, "end": { "line": 10, "column": 26 } } }, "property": { "type": "Identifier", "name": "timer", "range": [ 416, 421 ], "loc": { "start": { "line": 10, "column": 27 }, "end": { "line": 10, "column": 32 } } }, "range": [ 405, 421 ], "loc": { "start": { "line": 10, "column": 16 }, "end": { "line": 10, "column": 32 } } }, "arguments": [ { "type": "Literal", "value": 50, "raw": "50", "range": [ 422, 424 ], "loc": { "start": { "line": 10, "column": 33 }, "end": { "line": 10, "column": 35 } } }, { "type": "Literal", "value": 20, "raw": "20", "range": [ 426, 428 ], "loc": { "start": { "line": 10, "column": 37 }, "end": { "line": 10, "column": 39 } } }, { "type": "Identifier", "name": "rxTestScheduler", "range": [ 430, 445 ], "loc": { "start": { "line": 10, "column": 41 }, "end": { "line": 10, "column": 56 } } } ], "range": [ 405, 446 ], "loc": { "start": { "line": 10, "column": 16 }, "end": { "line": 10, "column": 57 } } }, "property": { "type": "Identifier", "name": "mapTo", "range": [ 468, 473 ], "loc": { "start": { "line": 11, "column": 21 }, "end": { "line": 11, "column": 26 } } }, "range": [ 405, 473 ], "loc": { "start": { "line": 10, "column": 16 }, "end": { "line": 11, "column": 26 } } }, "arguments": [ { "type": "Literal", "value": "ev", "raw": "'ev'", "range": [ 474, 478 ], "loc": { "start": { "line": 11, "column": 27 }, "end": { "line": 11, "column": 31 } } } ], "range": [ 405, 479 ], "loc": { "start": { "line": 10, "column": 16 }, "end": { "line": 11, "column": 32 } } }, "property": { "type": "Identifier", "name": "take", "range": [ 501, 505 ], "loc": { "start": { "line": 12, "column": 21 }, "end": { "line": 12, "column": 25 } } }, "range": [ 405, 505 ], "loc": { "start": { "line": 10, "column": 16 }, "end": { "line": 12, "column": 25 } } }, "arguments": [ { "type": "Literal", "value": 2, "raw": "2", "range": [ 506, 507 ], "loc": { "start": { "line": 12, "column": 26 }, "end": { "line": 12, "column": 27 } } } ], "range": [ 405, 508 ], "loc": { "start": { "line": 10, "column": 16 }, "end": { "line": 12, "column": 28 } } }, "property": { "type": "Identifier", "name": "concat", "range": [ 530, 536 ], "loc": { "start": { "line": 13, "column": 21 }, "end": { "line": 13, "column": 27 } } }, "range": [ 405, 536 ], "loc": { "start": { "line": 10, "column": 16 }, "end": { "line": 13, "column": 27 } } }, "arguments": [ { "type": "CallExpression", "callee": { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "Observable", "range": [ 537, 547 ], "loc": { "start": { "line": 13, "column": 28 }, "end": { "line": 13, "column": 38 } } }, "property": { "type": "Identifier", "name": "never", "range": [ 548, 553 ], "loc": { "start": { "line": 13, "column": 39 }, "end": { "line": 13, "column": 44 } } }, "range": [ 537, 553 ], "loc": { "start": { "line": 13, "column": 28 }, "end": { "line": 13, "column": 44 } } }, "arguments": [], "range": [ 537, 555 ], "loc": { "start": { "line": 13, "column": 28 }, "end": { "line": 13, "column": 46 } } } ], "range": [ 405, 556 ], "loc": { "start": { "line": 10, "column": 16 }, "end": { "line": 13, "column": 47 } } }, "property": { "type": "Identifier", "name": "subscribe", "range": [ 578, 587 ], "loc": { "start": { "line": 14, "column": 21 }, "end": { "line": 14, "column": 30 } } }, "range": [ 405, 587 ], "loc": { "start": { "line": 10, "column": 16 }, "end": { "line": 14, "column": 30 } } }, "arguments": [ { "type": "Identifier", "name": "listener", "range": [ 588,