@reactivex/rxjs
Version:
Reactive Extensions for modern JavaScript
1,367 lines (1,366 loc) • 575 kB
JSON
{
"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 {throttleTime} ",
"range": [
115,
142
],
"loc": {
"start": {
"line": 5,
"column": 0
},
"end": {
"line": 5,
"column": 27
}
}
}
]
},
{
"type": "ExpressionStatement",
"expression": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "describe",
"range": [
143,
151
],
"loc": {
"start": {
"line": 6,
"column": 0
},
"end": {
"line": 6,
"column": 8
}
}
},
"arguments": [
{
"type": "Literal",
"value": "Observable.prototype.throttleTime",
"raw": "'Observable.prototype.throttleTime'",
"range": [
152,
187
],
"loc": {
"start": {
"line": 6,
"column": 9
},
"end": {
"line": 6,
"column": 44
}
}
},
{
"type": "FunctionExpression",
"id": null,
"params": [],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "CallExpression",
"callee": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "asDiagram",
"range": [
207,
216
],
"loc": {
"start": {
"line": 7,
"column": 4
},
"end": {
"line": 7,
"column": 13
}
}
},
"arguments": [
{
"type": "Literal",
"value": "throttleTime(50)",
"raw": "'throttleTime(50)'",
"range": [
217,
235
],
"loc": {
"start": {
"line": 7,
"column": 14
},
"end": {
"line": 7,
"column": 32
}
}
}
],
"range": [
207,
236
],
"loc": {
"start": {
"line": 7,
"column": 4
},
"end": {
"line": 7,
"column": 33
}
}
},
"arguments": [
{
"type": "Literal",
"value": "should immediately emit the first value in each time window",
"raw": "'should immediately emit the first value in each time window'",
"range": [
237,
298
],
"loc": {
"start": {
"line": 7,
"column": 34
},
"end": {
"line": 7,
"column": 95
}
}
},
{
"type": "FunctionExpression",
"id": null,
"params": [],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "e1",
"range": [
326,
328
],
"loc": {
"start": {
"line": 8,
"column": 12
},
"end": {
"line": 8,
"column": 14
}
}
},
"init": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "hot",
"range": [
331,
334
],
"loc": {
"start": {
"line": 8,
"column": 17
},
"end": {
"line": 8,
"column": 20
}
}
},
"arguments": [
{
"type": "Literal",
"value": "-a-x-y----b---x-cx---|",
"raw": "'-a-x-y----b---x-cx---|'",
"range": [
335,
359
],
"loc": {
"start": {
"line": 8,
"column": 21
},
"end": {
"line": 8,
"column": 45
}
}
}
],
"range": [
331,
360
],
"loc": {
"start": {
"line": 8,
"column": 17
},
"end": {
"line": 8,
"column": 46
}
}
},
"range": [
326,
360
],
"loc": {
"start": {
"line": 8,
"column": 12
},
"end": {
"line": 8,
"column": 46
}
}
}
],
"kind": "var",
"range": [
322,
361
],
"loc": {
"start": {
"line": 8,
"column": 8
},
"end": {
"line": 8,
"column": 47
}
}
},
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "subs",
"range": [
374,
378
],
"loc": {
"start": {
"line": 9,
"column": 12
},
"end": {
"line": 9,
"column": 16
}
}
},
"init": {
"type": "Literal",
"value": "^ !",
"raw": "'^ !'",
"range": [
381,
405
],
"loc": {
"start": {
"line": 9,
"column": 19
},
"end": {
"line": 9,
"column": 43
}
}
},
"range": [
374,
405
],
"loc": {
"start": {
"line": 9,
"column": 12
},
"end": {
"line": 9,
"column": 43
}
}
}
],
"kind": "var",
"range": [
370,
406
],
"loc": {
"start": {
"line": 9,
"column": 8
},
"end": {
"line": 9,
"column": 44
}
}
},
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "expected",
"range": [
419,
427
],
"loc": {
"start": {
"line": 10,
"column": 12
},
"end": {
"line": 10,
"column": 20
}
}
},
"init": {
"type": "Literal",
"value": "-a--------b-----c----|",
"raw": "'-a--------b-----c----|'",
"range": [
430,
454
],
"loc": {
"start": {
"line": 10,
"column": 23
},
"end": {
"line": 10,
"column": 47
}
}
},
"range": [
419,
454
],
"loc": {
"start": {
"line": 10,
"column": 12
},
"end": {
"line": 10,
"column": 47
}
}
}
],
"kind": "var",
"range": [
415,
455
],
"loc": {
"start": {
"line": 10,
"column": 8
},
"end": {
"line": 10,
"column": 48
}
}
},
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "result",
"range": [
468,
474
],
"loc": {
"start": {
"line": 11,
"column": 12
},
"end": {
"line": 11,
"column": 18
}
}
},
"init": {
"type": "CallExpression",
"callee": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "Identifier",
"name": "e1",
"range": [
477,
479
],
"loc": {
"start": {
"line": 11,
"column": 21
},
"end": {
"line": 11,
"column": 23
}
}
},
"property": {
"type": "Identifier",
"name": "throttleTime",
"range": [
480,
492
],
"loc": {
"start": {
"line": 11,
"column": 24
},
"end": {
"line": 11,
"column": 36
}
}
},
"range": [
477,
492
],
"loc": {
"start": {
"line": 11,
"column": 21
},
"end": {
"line": 11,
"column": 36
}
}
},
"arguments": [
{
"type": "Literal",
"value": 50,
"raw": "50",
"range": [
493,
495
],
"loc": {
"start": {
"line": 11,
"column": 37
},
"end": {
"line": 11,
"column": 39
}
}
},
{
"type": "Identifier",
"name": "rxTestScheduler",
"range": [
497,
512
],
"loc": {
"start": {
"line": 11,
"column": 41
},
"end": {
"line": 11,
"column": 56
}
}
}
],
"range": [
477,
513
],
"loc": {
"start": {
"line": 11,
"column": 21
},
"end": {
"line": 11,
"column": 57
}
}
},
"range": [
468,
513
],
"loc": {
"start": {
"line": 11,
"column": 12
},
"end": {
"line": 11,
"column": 57
}
}
}
],
"kind": "var",
"range": [
464,
514
],
"loc": {
"start": {
"line": 11,
"column": 8
},
"end": {
"line": 11,
"column": 58
}
}
},
{
"type": "ExpressionStatement",
"expression": {
"type": "CallExpression",
"callee": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "expectObservable",
"range": [
523,
539
],
"loc": {
"start": {
"line": 12,
"column": 8
},
"end": {
"line": 12,
"column": 24
}
}
},
"arguments": [
{
"type": "Identifier",
"name": "result",
"range": [
540,
546
],
"loc": {
"start": {
"line": 12,
"column": 25
},
"end": {
"line": 12,
"column": 31
}
}
}
],
"range": [
523,
547
],
"loc": {
"start": {
"line": 12,
"column": 8
},
"end": {
"line": 12,
"column": 32
}
}
},
"property": {
"type": "Identifier",
"name": "toBe",
"range": [
548,
552
],
"loc": {
"start": {
"line": 12,
"column": 33
},
"end": {
"line": 12,
"column": 37
}
}
},
"range": [
523,
552
],
"loc": {
"start": {
"line": 12,
"column": 8
},
"end": {
"line": 12,
"column": 37
}
}
},
"arguments": [
{
"type": "Identifier",
"name": "expected",
"range": [
553,
561
],
"loc": {
"start": {
"line": 12,
"column": 38
},
"end": {
"line": 12,
"column": 46
}
}
}
],
"range": [
523,
562
],
"loc": {
"start": {
"line": 12,
"column": 8
},
"end": {
"line": 12,
"column": 47
}
}
},
"range": [
523,
563
],
"loc": {
"start": {
"line": 12,
"column": 8
},
"end": {
"line": 12,
"column": 48
}
}
},
{
"type": "ExpressionStatement",
"expression": {
"type": "CallExpression",
"callee": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "expectSubscriptions",
"range": [
572,
591
],
"loc": {
"start": {
"line": 13,
"column": 8
},
"end": {
"line": 13,
"column": 27
}
}
},
"arguments": [
{
"type": "MemberExpression",
"computed": false,
"object": {
"type": "Identifier",
"name": "e1",
"range": [
592,
594
],
"loc": {
"start": {
"line": 13,
"column": 28
},
"end": {
"line": 13,
"column": 30
}
}
},
"property": {
"type": "Identifier",
"name": "subscriptions",
"range": [
595,
608
],
"loc": {
"start": {
"line": 13,
"column": 31
},
"end": {
"line": 13,
"column": 44
}
}
},
"range": [
592,
608
],
"loc": {
"start": {
"line": 13,
"column": 28
},
"end": {
"line": 13,
"column": 44
}
}
}
],
"range": [
572,
609
],
"loc": {
"start": {
"line": 13,
"column": 8
},
"end": {
"line": 13,
"column": 45
}
}
},
"property": {
"type": "Identifier",
"name": "toBe",
"range": [
610,
614
],
"loc": {
"start": {
"line": 13,
"column": 46
},
"end": {
"line": 13,
"column": 50
}
}
},
"range": [
572,
614
],
"loc": {
"start": {
"line": 13,
"column": 8
},
"end": {
"line": 13,
"column": 50
}
}
},
"arguments": [
{
"type": "Identifier",
"name": "subs",
"range": [
615,
619
],
"loc": {
"start": {
"line": 13,
"column": 51
},
"end": {
"line": 13,
"column": 55
}
}
}
],
"range": [
572,
620
],
"loc": {
"start": {
"line": 13,
"column": 8
},
"end": {
"line": 13,
"column": 56
}
}
},
"range": [
572,
621
],
"loc": {
"start": {
"line": 13,
"column": 8
},
"end": {
"line": 13,
"column": 57
}
}
}
],
"range": [
312,
627
],
"loc": {
"start": {
"line": 7,
"column": 109
},
"end": {
"line": 14,
"column": 5
}
}
},
"generator": false,
"expression": false,
"range": [
300,
627
],
"loc": {
"start": {
"line": 7,
"column": 97
},
"end": {
"line": 14,
"column": 5
}
}
}
],
"range": [
207,
628
],
"loc": {
"start": {
"line": 7,
"column": 4
},
"end": {
"line": 14,
"column": 6
}
}
},
"range": [
207,
629
],
"loc": {
"start": {
"line": 7,
"column": 4
},
"end": {
"line": 14,
"column": 7
}
}
},
{
"type": "ExpressionStatement",
"expression": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "it",
"range": [
634,
636
],
"loc": {
"start": {
"line": 15,
"column": 4
},
"end": {
"line": 15,
"column": 6
}
}
},
"arguments": [
{
"type": "Literal",
"value": "should throttle events by 50 time units",