@reactivex/rxjs
Version:
Reactive Extensions for modern JavaScript
1,761 lines (1,760 loc) • 321 kB
JSON
{
"type": "Program",
"body": [
{
"type": "ImportDeclaration",
"specifiers": [
{
"type": "ImportSpecifier",
"local": {
"type": "Identifier",
"name": "async",
"range": [
9,
14
],
"loc": {
"start": {
"line": 1,
"column": 9
},
"end": {
"line": 1,
"column": 14
}
}
},
"imported": {
"type": "Identifier",
"name": "async",
"range": [
9,
14
],
"loc": {
"start": {
"line": 1,
"column": 9
},
"end": {
"line": 1,
"column": 14
}
}
},
"range": [
9,
14
],
"loc": {
"start": {
"line": 1,
"column": 9
},
"end": {
"line": 1,
"column": 14
}
}
}
],
"source": {
"type": "Literal",
"value": "../scheduler/async",
"raw": "'../scheduler/async'",
"range": [
22,
42
],
"loc": {
"start": {
"line": 1,
"column": 22
},
"end": {
"line": 1,
"column": 42
}
}
},
"range": [
0,
43
],
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 43
}
}
},
{
"type": "ImportDeclaration",
"specifiers": [
{
"type": "ImportSpecifier",
"local": {
"type": "Identifier",
"name": "isDate",
"range": [
53,
59
],
"loc": {
"start": {
"line": 2,
"column": 9
},
"end": {
"line": 2,
"column": 15
}
}
},
"imported": {
"type": "Identifier",
"name": "isDate",
"range": [
53,
59
],
"loc": {
"start": {
"line": 2,
"column": 9
},
"end": {
"line": 2,
"column": 15
}
}
},
"range": [
53,
59
],
"loc": {
"start": {
"line": 2,
"column": 9
},
"end": {
"line": 2,
"column": 15
}
}
}
],
"source": {
"type": "Literal",
"value": "../util/isDate",
"raw": "'../util/isDate'",
"range": [
67,
83
],
"loc": {
"start": {
"line": 2,
"column": 23
},
"end": {
"line": 2,
"column": 39
}
}
},
"range": [
44,
84
],
"loc": {
"start": {
"line": 2,
"column": 0
},
"end": {
"line": 2,
"column": 40
}
}
},
{
"type": "ImportDeclaration",
"specifiers": [
{
"type": "ImportSpecifier",
"local": {
"type": "Identifier",
"name": "Subscriber",
"range": [
94,
104
],
"loc": {
"start": {
"line": 3,
"column": 9
},
"end": {
"line": 3,
"column": 19
}
}
},
"imported": {
"type": "Identifier",
"name": "Subscriber",
"range": [
94,
104
],
"loc": {
"start": {
"line": 3,
"column": 9
},
"end": {
"line": 3,
"column": 19
}
}
},
"range": [
94,
104
],
"loc": {
"start": {
"line": 3,
"column": 9
},
"end": {
"line": 3,
"column": 19
}
}
}
],
"source": {
"type": "Literal",
"value": "../Subscriber",
"raw": "'../Subscriber'",
"range": [
112,
127
],
"loc": {
"start": {
"line": 3,
"column": 27
},
"end": {
"line": 3,
"column": 42
}
}
},
"range": [
85,
128
],
"loc": {
"start": {
"line": 3,
"column": 0
},
"end": {
"line": 3,
"column": 43
}
}
},
{
"type": "ImportDeclaration",
"specifiers": [
{
"type": "ImportSpecifier",
"local": {
"type": "Identifier",
"name": "TimeoutError",
"range": [
138,
150
],
"loc": {
"start": {
"line": 4,
"column": 9
},
"end": {
"line": 4,
"column": 21
}
}
},
"imported": {
"type": "Identifier",
"name": "TimeoutError",
"range": [
138,
150
],
"loc": {
"start": {
"line": 4,
"column": 9
},
"end": {
"line": 4,
"column": 21
}
}
},
"range": [
138,
150
],
"loc": {
"start": {
"line": 4,
"column": 9
},
"end": {
"line": 4,
"column": 21
}
}
}
],
"source": {
"type": "Literal",
"value": "../util/TimeoutError",
"raw": "'../util/TimeoutError'",
"range": [
158,
180
],
"loc": {
"start": {
"line": 4,
"column": 29
},
"end": {
"line": 4,
"column": 51
}
}
},
"range": [
129,
181
],
"loc": {
"start": {
"line": 4,
"column": 0
},
"end": {
"line": 4,
"column": 52
}
},
"trailingComments": [
{
"type": "Block",
"value": "*\n * @param due\n * @param errorToSend\n * @param scheduler\n * @return {Observable<R>|WebSocketSubject<T>|Observable<T>}\n * @method timeout\n * @owner Observable\n ",
"range": [
182,
346
],
"loc": {
"start": {
"line": 5,
"column": 0
},
"end": {
"line": 12,
"column": 3
}
}
}
]
},
{
"type": "ExportNamedDeclaration",
"declaration": {
"type": "FunctionDeclaration",
"id": {
"type": "Identifier",
"name": "timeout",
"range": [
363,
370
],
"loc": {
"start": {
"line": 13,
"column": 16
},
"end": {
"line": 13,
"column": 23
}
}
},
"params": [
{
"type": "Identifier",
"name": "due",
"range": [
371,
374
],
"loc": {
"start": {
"line": 13,
"column": 24
},
"end": {
"line": 13,
"column": 27
}
}
},
{
"type": "Identifier",
"name": "errorToSend",
"range": [
376,
387
],
"loc": {
"start": {
"line": 13,
"column": 29
},
"end": {
"line": 13,
"column": 40
}
}
},
{
"type": "Identifier",
"name": "scheduler",
"range": [
389,
398
],
"loc": {
"start": {
"line": 13,
"column": 42
},
"end": {
"line": 13,
"column": 51
}
}
}
],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "IfStatement",
"test": {
"type": "BinaryExpression",
"operator": "===",
"left": {
"type": "Identifier",
"name": "errorToSend",
"range": [
410,
421
],
"loc": {
"start": {
"line": 14,
"column": 8
},
"end": {
"line": 14,
"column": 19
}
}
},
"right": {
"type": "UnaryExpression",
"operator": "void",
"argument": {
"type": "Literal",
"value": 0,
"raw": "0",
"range": [
431,
432
],
"loc": {
"start": {
"line": 14,
"column": 29
},
"end": {
"line": 14,
"column": 30
}
}
},
"prefix": true,
"range": [
426,
432
],
"loc": {
"start": {
"line": 14,
"column": 24
},
"end": {
"line": 14,
"column": 30
}
}
},
"range": [
410,
432
],
"loc": {
"start": {
"line": 14,
"column": 8
},
"end": {
"line": 14,
"column": 30
}
}
},
"consequent": {
"type": "BlockStatement",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "AssignmentExpression",
"operator": "=",
"left": {
"type": "Identifier",
"name": "errorToSend",
"range": [
436,
447
],
"loc": {
"start": {
"line": 14,
"column": 34
},
"end": {
"line": 14,
"column": 45
}
}
},
"right": {
"type": "Literal",
"value": null,
"raw": "null",
"range": [
450,
454
],
"loc": {
"start": {
"line": 14,
"column": 48
},
"end": {
"line": 14,
"column": 52
}
}
},
"range": [
436,
454
],
"loc": {
"start": {
"line": 14,
"column": 34
},
"end": {
"line": 14,
"column": 52
}
}
},
"range": [
436,
455
],
"loc": {
"start": {
"line": 14,
"column": 34
},
"end": {
"line": 14,
"column": 53
}
}
}
],
"range": [
434,
457
],
"loc": {
"start": {
"line": 14,
"column": 32
},
"end": {
"line": 14,
"column": 55
}
}
},
"alternate": null,
"range": [
406,
457
],
"loc": {
"start": {
"line": 14,
"column": 4
},
"end": {
"line": 14,
"column": 55
}
}
},
{
"type": "IfStatement",
"test": {
"type": "BinaryExpression",
"operator": "===",
"left": {
"type": "Identifier",
"name": "scheduler",
"range": [
466,
475
],
"loc": {
"start": {
"line": 15,
"column": 8
},
"end": {
"line": 15,
"column": 17
}
}
},
"right": {
"type": "UnaryExpression",
"operator": "void",
"argument": {
"type": "Literal",
"value": 0,
"raw": "0",
"range": [
485,
486
],
"loc": {
"start": {
"line": 15,
"column": 27
},
"end": {
"line": 15,
"column": 28
}
}
},
"prefix": true,
"range": [
480,
486
],
"loc": {
"start": {
"line": 15,
"column": 22
},
"end": {
"line": 15,
"column": 28
}
}
},
"range": [
466,
486
],
"loc": {
"start": {
"line": 15,
"column": 8
},
"end": {
"line": 15,
"column": 28
}
}
},
"consequent": {
"type": "BlockStatement",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "AssignmentExpression",
"operator": "=",
"left": {
"type": "Identifier",
"name": "scheduler",
"range": [
490,
499
],
"loc": {
"start": {
"line": 15,
"column": 32
},
"end": {
"line": 15,
"column": 41
}
}
},
"right": {
"type": "Identifier",
"name": "async",
"range": [
502,
507
],
"loc": {
"start": {
"line": 15,
"column": 44
},
"end": {
"line": 15,
"column": 49
}
}
},
"range": [
490,
507
],
"loc": {
"start": {
"line": 15,
"column": 32
},
"end": {
"line": 15,
"column": 49
}
}
},
"range": [
490,
508
],
"loc": {
"start": {
"line": 15,
"column": 32
},
"end": {
"line": 15,
"column": 50
}
}
}
],
"range": [
488,
510
],
"loc": {
"start": {
"line": 15,
"column": 30
},
"end": {
"line": 15,
"column": 52
}
}
},
"alternate": null,
"range": [
462,
510
],
"loc": {
"start": {
"line": 15,
"column": 4
},
"end": {
"line": 15,
"column": 52
}
}
},
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "absoluteTimeout",
"range": [
519,
534
],
"loc": {
"start": {
"line": 16,
"column": 8
},
"end": {
"line": 16,
"column": 23
}
}
},
"init": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "isDate",
"range": [
537,
543
],
"loc": {
"start": {
"line": 16,
"column": 26
},
"end": {
"line": 16,
"column": 32
}
}
},
"arguments": [
{
"type": "Identifier",
"name": "due",
"range": [
544,
547
],
"loc": {
"start": {
"line": 16,
"column": 33
},
"end": {
"line": 16,
"column": 36
}
}
}
],
"range": [
537,
548
],
"loc": {
"start": {
"line": 16,
"column": 26
},
"end": {
"line": 16,
"column": 37
}
}
},
"range": [
519,
548
],
"loc": {
"start": {
"line": 16,
"column": 8
},
"end": {
"line": 16,
"column": 37
}
}
}
],
"kind": "var",
"range": [
515,
549
],
"loc": {
"start": {
"line": 16,
"column": 4
},
"end": {
"line": 16,
"column": 38
}
}
},
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "waitFor",
"range": [
558,
565
],
"loc": {
"start": {
"line": 17,
"column": 8
},
"end": {
"line": 17,
"column": 15
}
}
},
"init": {
"type": "ConditionalExpression",
"test": {
"type": "Identifier",
"name": "absoluteTimeout",
"range": [
568,
583
],
"loc": {
"start": {
"line": 17,
"column": 18
},
"end": {
"line": 17,
"column": 33
}
}
},
"consequent": {
"type": "BinaryExpression",
"operator": "-",
"left": {
"type": "UnaryExpression",
"operator": "+",
"argument": {
"type": "Identifier",
"name": "due",
"range": [
588,
591
],
"loc": {
"start": {
"line": 17,
"column": 38
},
"end": {
"line": 17,
"column": 41
}
}
},
"prefix": true,
"range": [
587,
591
],
"loc": {
"start": {
"line": 17,
"column": 37
},
"end": {
"line": 17,
"column": 41
}
}
},
"right": {
"type": "CallExpression",
"callee": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "Identifier",
"name": "scheduler",
"range": [
594,
603
],
"loc": {
"start": {
"line": 17,
"column": 44
},
"end": {
"line": 17,
"column": 53
}
}
},
"property": {
"type": "Identifier",
"name": "now",
"range": [
604,
607
],
"loc": {
"start": {
"line": 17,
"column": 54
},
"end": {
"line": 17,
"column": 57
}
}
},
"range": [
594,
607
],
"loc": {
"start": {
"line": 17,
"column": 44
},
"end": {
"line": 17,
"column": 57
}
}
},
"arguments": [],
"range": [
594,
609
],
"loc": {
"start": {
"line": 17,
"column": 44
},
"end": {
"line": 17,
"column": 59
}
}
},
"range": [
587,
609
],
"loc": {
"start": {
"line": 17,
"column": 37
},
"end": {
"line": 17,
"column": 59
}
}
},
"alternate": {
"type": "CallExpression",
"callee": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "Identifier",
"name": "Math",
"range": [
613,
617
],
"loc": {
"start": {
"line": 17,
"column": 63
},
"end": {
"line": 17,
"column": 67
}
}
},
"property": {
"type": "Identifier",
"name": "abs",
"range": [
618,
621
],
"loc": {
"start": {
"line": 17,
"column": 68
},
"end": {
"line": 17,
"column": 71
}
}
},
"range": [
613,
621
],
"loc": {
"start": {
"line": 17,
"column": 63
},
"end": {
"line": 17,
"column": 71
}
}
},
"arguments": [
{
"type": "Identifier",
"name": "due",
"range": [
622,
625
],
"loc": {
"start": {
"line": 17,
"column": 72
},
"end": {
"line": 17,
"column": 75
}
}
}
],
"range": [
613,
626
],
"loc": {
"start": {
"line": 17,
"column": 63
},
"end": {
"line": 17,
"column": 76
}
}
},
"range": [
568,
626
],
"loc": {
"start": {
"line": 17,
"column": 18
},
"end": {
"line": 17,
"column": 76
}
}
},
"range": [
558,
626
],
"loc": {
"start": {
"line": 17,
"column": 8
},
"end": {
"line": 17,
"column": 76
}
}
}
],
"kind": "var",
"range": [
554,
627
],
"loc": {
"start": {
"line": 17,
"column": 4
},
"end": {
"line": 17,
"column": 77
}
}
},
{
"type": "ReturnStatement",
"argument": {
"type": "CallExpression",
"callee": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "ThisExpression",
"range": [
639,
643
],
"loc": {
"start": {
"line": 18,
"column": 11
},
"end": {
"line": 18,
"column": 15
}
}
},
"property": {
"type": "Identifier",
"name": "lift",
"range": [
644,
648
],
"loc": {
"start": {
"line": 18,
"column": 16
},
"end": {
"line": 18,
"column": 20
}
}
},
"range": [
639,
648
],
"loc": {
"start": {
"line": 18,
"column": 11
},
"end": {
"line": 18,
"column": 20
}
}
},
"arguments": [
{
"type": "NewExpression",
"callee": {
"type": "Identifier",
"name": "TimeoutOperator",
"range": [
653,
668
],
"loc": {
"start": {
"line": 18,
"column": 25
},
"end": {
"line": 18,
"column": 40
}
}
},
"arguments": [
{
"type": "Identifier",
"name": "waitFor",
"range": [
669,
676
],
"loc": {
"start": {
"line": 18,
"column": 41
},
"end": {
"line": 18,
"column": 48
}
}
},
{
"type": "Identifier",
"name": "absoluteTimeout",
"range": [
678,
693
],
"loc": {
"start": {
"line": 18,
"column": 50
},
"end": {
"line": 18,
"column": 65
}
}
},
{
"type": "Identifier",
"name": "errorToSend",
"range": [
695,
706
],
"loc": {
"start": {
"line": 18,
"column": 67
},
"end": {
"line": 18,
"column": 78
}
}
},
{
"type": "Identifier",
"name": "scheduler",
"range": [
708,
717
],
"loc": {
"start": {
"line": 18,
"column": 80
},
"end": {
"line": 18,
"column": 89
}
}
}
],
"range": [
649,
718
],
"loc": {
"start": {
"line": 18,
"column": 21
},
"end": {
"line": 18,
"column": 90
}
}
}
],
"range": [
639,
719
],
"loc": {
"start": {
"line": 18,
"column": 11
},
"end": {
"line": 18,
"column": 91
}
}
},
"range": [
632,
720
],
"loc": {
"start": {
"line": 18,
"column": 4
},
"end": {
"line": 18,
"column": 92
}
}
}
],
"range": [
400,
722
],
"loc": {
"start": {
"line": 13,
"column": 53
},
"end": {
"line": 19,
"column": 1
}
}
},
"generator": false,
"expression": false,
"range": [
354,
722
],
"loc": {
"start": {
"line": 13,
"column": 7
},
"end": {
"line": 19,
"column": 1
}
},
"leadingComments": [
{
"type": "Block",
"value": "*\n * @param due\n * @param errorToSend\n * @param scheduler\n * @return {Observable<R>|WebSocketSubject<T>|Observable<T>}\n * @method timeout\n * @owner Observable\n ",
"range": [
182,
346
],
"loc": {
"start": {
"line": 5,
"column": 0
},
"end": {
"line": 12,
"column": 3
}
}
}
],
"trailingComments": []
},
"specifiers": [],
"source": null,
"range": [
347,
722
],
"loc": {
"start": {
"line": 13,
"column": 0
},
"end": {
"line": 19,
"column": 1
}
},
"leadingComments": [
{
"type": "Block",
"value": "*\n * @param due\n * @param errorToSend\n * @param scheduler\n * @return {Observable<R>|WebSocketSubject<T>|Observable<T>}\n * @method timeout\n * @owner Observable\n ",
"range": [
182,
346
],
"loc": {
"start": {
"line": 5,
"column": 0
},
"end": {
"line": 12,
"column": 3
}
}
}
]
},
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "TimeoutOperator",
"range": [
727,
742
],
"loc": {
"start": {
"line": 20,
"column": 4
},
"end": {
"line": 20,
"column": 19
}
}
},
"init": {
"type": "CallExpression",
"callee": {
"type": "FunctionExpression",
"id": null,
"params": [],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "FunctionDeclaration",
"id": {
"type": "Identifier",
"name": "TimeoutOperator",
"range": [
773,
788
],
"loc": {
"start": {
"line": 21,
"column": 13
},
"end": {
"line": 21,
"column": 28
}
}
},
"params": [
{
"type": "Identifier",
"name": "waitFor",
"range": [
789,
796
],
"loc": {
"start": {
"line": 21,
"column": 29
},
"end": {
"line": 21,
"column": 36
}
}
},
{
"type": "Identifier",
"name": "absoluteTimeout",
"range": [
798,
813
],
"loc": {
"start": {
"line": 21,
"column": 38
},
"end": {
"line": 21,
"column": 53
}
}
},
{
"type": "Identifier",
"name": "errorToSend",
"range": [
815,
826
],
"loc": {
"start": {
"line": 21,
"column": 55
},
"end": {
"line": 21,
"column": 66
}
}
},
{
"type": "Identifier",
"name": "scheduler",
"range": [
828,
837
],
"loc": {
"start": {
"line": 21,
"column": 68
},
"end": {
"line": 21,
"column": 77
}
}
}
],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "AssignmentExpression",
"operator": "=",
"left": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "ThisExpression",
"range": [
849,
853
],
"loc": {
"start": {
"line": 22,
"column": 8
},
"end": {
"line": 22,
"column": 12
}
}
},
"property": {
"type": "Identifier",
"name": "waitFor",
"range": [
854,
861
],
"loc": {
"start": {
"line": 22,
"column": 13
},
"end": {
"line": 22,
"column": 20
}
}
},
"range": [
849,
861
],
"loc": {
"start": {
"line": 22,
"column": 8
},
"end": {
"line": 22,
"column": 20
}
}
},
"right": {
"type": "Identifier",
"name": "waitFor",
"range": [
864,
871
],
"loc": {
"start": {
"line": 22,
"column": 23
},
"end": {
"line": 22,
"column": 30
}
}
},
"range": [
849,
871
],
"loc": {
"start": {
"line": 22,
"column": 8
},
"end": {
"line": 22,
"column": 30
}
}
},