@reactivex/rxjs
Version:
Reactive Extensions for modern JavaScript
1,244 lines (1,243 loc) • 1.05 MB
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": "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 {reduce} ",
"range": [
85,
106
],
"loc": {
"start": {
"line": 4,
"column": 0
},
"end": {
"line": 4,
"column": 21
}
}
}
]
},
{
"type": "ExpressionStatement",
"expression": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "describe",
"range": [
107,
115
],
"loc": {
"start": {
"line": 5,
"column": 0
},
"end": {
"line": 5,
"column": 8
}
}
},
"arguments": [
{
"type": "Literal",
"value": "Observable.prototype.reduce",
"raw": "'Observable.prototype.reduce'",
"range": [
116,
145
],
"loc": {
"start": {
"line": 5,
"column": 9
},
"end": {
"line": 5,
"column": 38
}
}
},
{
"type": "FunctionExpression",
"id": null,
"params": [],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "CallExpression",
"callee": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "asDiagram",
"range": [
165,
174
],
"loc": {
"start": {
"line": 6,
"column": 4
},
"end": {
"line": 6,
"column": 13
}
}
},
"arguments": [
{
"type": "Literal",
"value": "reduce((acc, curr) => acc + curr, 0)",
"raw": "'reduce((acc, curr) => acc + curr, 0)'",
"range": [
175,
213
],
"loc": {
"start": {
"line": 6,
"column": 14
},
"end": {
"line": 6,
"column": 52
}
}
}
],
"range": [
165,
214
],
"loc": {
"start": {
"line": 6,
"column": 4
},
"end": {
"line": 6,
"column": 53
}
}
},
"arguments": [
{
"type": "Literal",
"value": "should reduce",
"raw": "'should reduce'",
"range": [
215,
230
],
"loc": {
"start": {
"line": 6,
"column": 54
},
"end": {
"line": 6,
"column": 69
}
}
},
{
"type": "FunctionExpression",
"id": null,
"params": [],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "values",
"range": [
258,
264
],
"loc": {
"start": {
"line": 7,
"column": 12
},
"end": {
"line": 7,
"column": 18
}
}
},
"init": {
"type": "ObjectExpression",
"properties": [
{
"type": "Property",
"key": {
"type": "Identifier",
"name": "a",
"range": [
281,
282
],
"loc": {
"start": {
"line": 8,
"column": 12
},
"end": {
"line": 8,
"column": 13
}
}
},
"value": {
"type": "Literal",
"value": 1,
"raw": "1",
"range": [
284,
285
],
"loc": {
"start": {
"line": 8,
"column": 15
},
"end": {
"line": 8,
"column": 16
}
}
},
"kind": "init",
"method": false,
"shorthand": false,
"computed": false,
"range": [
281,
285
],
"loc": {
"start": {
"line": 8,
"column": 12
},
"end": {
"line": 8,
"column": 16
}
}
},
{
"type": "Property",
"key": {
"type": "Identifier",
"name": "b",
"range": [
287,
288
],
"loc": {
"start": {
"line": 8,
"column": 18
},
"end": {
"line": 8,
"column": 19
}
}
},
"value": {
"type": "Literal",
"value": 3,
"raw": "3",
"range": [
290,
291
],
"loc": {
"start": {
"line": 8,
"column": 21
},
"end": {
"line": 8,
"column": 22
}
}
},
"kind": "init",
"method": false,
"shorthand": false,
"computed": false,
"range": [
287,
291
],
"loc": {
"start": {
"line": 8,
"column": 18
},
"end": {
"line": 8,
"column": 22
}
}
},
{
"type": "Property",
"key": {
"type": "Identifier",
"name": "c",
"range": [
293,
294
],
"loc": {
"start": {
"line": 8,
"column": 24
},
"end": {
"line": 8,
"column": 25
}
}
},
"value": {
"type": "Literal",
"value": 5,
"raw": "5",
"range": [
296,
297
],
"loc": {
"start": {
"line": 8,
"column": 27
},
"end": {
"line": 8,
"column": 28
}
}
},
"kind": "init",
"method": false,
"shorthand": false,
"computed": false,
"range": [
293,
297
],
"loc": {
"start": {
"line": 8,
"column": 24
},
"end": {
"line": 8,
"column": 28
}
}
},
{
"type": "Property",
"key": {
"type": "Identifier",
"name": "x",
"range": [
299,
300
],
"loc": {
"start": {
"line": 8,
"column": 30
},
"end": {
"line": 8,
"column": 31
}
}
},
"value": {
"type": "Literal",
"value": 9,
"raw": "9",
"range": [
302,
303
],
"loc": {
"start": {
"line": 8,
"column": 33
},
"end": {
"line": 8,
"column": 34
}
}
},
"kind": "init",
"method": false,
"shorthand": false,
"computed": false,
"range": [
299,
303
],
"loc": {
"start": {
"line": 8,
"column": 30
},
"end": {
"line": 8,
"column": 34
}
}
}
],
"range": [
267,
313
],
"loc": {
"start": {
"line": 7,
"column": 21
},
"end": {
"line": 9,
"column": 9
}
}
},
"range": [
258,
313
],
"loc": {
"start": {
"line": 7,
"column": 12
},
"end": {
"line": 9,
"column": 9
}
}
}
],
"kind": "var",
"range": [
254,
314
],
"loc": {
"start": {
"line": 7,
"column": 8
},
"end": {
"line": 9,
"column": 10
}
}
},
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "e1",
"range": [
327,
329
],
"loc": {
"start": {
"line": 10,
"column": 12
},
"end": {
"line": 10,
"column": 14
}
}
},
"init": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "hot",
"range": [
332,
335
],
"loc": {
"start": {
"line": 10,
"column": 17
},
"end": {
"line": 10,
"column": 20
}
}
},
"arguments": [
{
"type": "Literal",
"value": "--a--b--c--|",
"raw": "'--a--b--c--|'",
"range": [
336,
350
],
"loc": {
"start": {
"line": 10,
"column": 21
},
"end": {
"line": 10,
"column": 35
}
}
},
{
"type": "Identifier",
"name": "values",
"range": [
352,
358
],
"loc": {
"start": {
"line": 10,
"column": 37
},
"end": {
"line": 10,
"column": 43
}
}
}
],
"range": [
332,
359
],
"loc": {
"start": {
"line": 10,
"column": 17
},
"end": {
"line": 10,
"column": 44
}
}
},
"range": [
327,
359
],
"loc": {
"start": {
"line": 10,
"column": 12
},
"end": {
"line": 10,
"column": 44
}
}
}
],
"kind": "var",
"range": [
323,
360
],
"loc": {
"start": {
"line": 10,
"column": 8
},
"end": {
"line": 10,
"column": 45
}
}
},
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "e1subs",
"range": [
373,
379
],
"loc": {
"start": {
"line": 11,
"column": 12
},
"end": {
"line": 11,
"column": 18
}
}
},
"init": {
"type": "Literal",
"value": "^ !",
"raw": "'^ !'",
"range": [
382,
396
],
"loc": {
"start": {
"line": 11,
"column": 21
},
"end": {
"line": 11,
"column": 35
}
}
},
"range": [
373,
396
],
"loc": {
"start": {
"line": 11,
"column": 12
},
"end": {
"line": 11,
"column": 35
}
}
}
],
"kind": "var",
"range": [
369,
397
],
"loc": {
"start": {
"line": 11,
"column": 8
},
"end": {
"line": 11,
"column": 36
}
}
},
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "expected",
"range": [
410,
418
],
"loc": {
"start": {
"line": 12,
"column": 12
},
"end": {
"line": 12,
"column": 20
}
}
},
"init": {
"type": "Literal",
"value": "-----------(x|)",
"raw": "'-----------(x|)'",
"range": [
421,
438
],
"loc": {
"start": {
"line": 12,
"column": 23
},
"end": {
"line": 12,
"column": 40
}
}
},
"range": [
410,
438
],
"loc": {
"start": {
"line": 12,
"column": 12
},
"end": {
"line": 12,
"column": 40
}
}
}
],
"kind": "var",
"range": [
406,
439
],
"loc": {
"start": {
"line": 12,
"column": 8
},
"end": {
"line": 12,
"column": 41
}
}
},
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "reduceFunction",
"range": [
452,
466
],
"loc": {
"start": {
"line": 13,
"column": 12
},
"end": {
"line": 13,
"column": 26
}
}
},
"init": {
"type": "FunctionExpression",
"id": null,
"params": [
{
"type": "Identifier",
"name": "o",
"range": [
479,
480
],
"loc": {
"start": {
"line": 13,
"column": 39
},
"end": {
"line": 13,
"column": 40
}
}
},
{
"type": "Identifier",
"name": "x",
"range": [
482,
483
],
"loc": {
"start": {
"line": 13,
"column": 42
},
"end": {
"line": 13,
"column": 43
}
}
}
],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "ReturnStatement",
"argument": {
"type": "BinaryExpression",
"operator": "+",
"left": {
"type": "Identifier",
"name": "o",
"range": [
506,
507
],
"loc": {
"start": {
"line": 14,
"column": 19
},
"end": {
"line": 14,
"column": 20
}
}
},
"right": {
"type": "Identifier",
"name": "x",
"range": [
510,
511
],
"loc": {
"start": {
"line": 14,
"column": 23
},
"end": {
"line": 14,
"column": 24
}
}
},
"range": [
506,
511
],
"loc": {
"start": {
"line": 14,
"column": 19
},
"end": {
"line": 14,
"column": 24
}
}
},
"range": [
499,
512
],
"loc": {
"start": {
"line": 14,
"column": 12
},
"end": {
"line": 14,
"column": 25
}
}
}
],
"range": [
485,
522
],
"loc": {
"start": {
"line": 13,
"column": 45
},
"end": {
"line": 15,
"column": 9
}
}
},
"generator": false,
"expression": false,
"range": [
469,
522
],
"loc": {
"start": {
"line": 13,
"column": 29
},
"end": {
"line": 15,
"column": 9
}
}
},
"range": [
452,
522
],
"loc": {
"start": {
"line": 13,
"column": 12
},
"end": {
"line": 15,
"column": 9
}
}
}
],
"kind": "var",
"range": [
448,
523
],
"loc": {
"start": {
"line": 13,
"column": 8
},
"end": {
"line": 15,
"column": 10
}
}
},
{
"type": "ExpressionStatement",
"expression": {
"type": "CallExpression",
"callee": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "expectObservable",
"range": [
532,
548
],
"loc": {
"start": {
"line": 16,
"column": 8
},
"end": {
"line": 16,
"column": 24
}
}
},
"arguments": [
{
"type": "CallExpression",
"callee": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "Identifier",
"name": "e1",
"range": [
549,
551
],
"loc": {
"start": {