@reactivex/rxjs
Version:
Reactive Extensions for modern JavaScript
1,302 lines (1,301 loc) • 1.08 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": "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 {scan} ",
"range": [
115,
134
],
"loc": {
"start": {
"line": 5,
"column": 0
},
"end": {
"line": 5,
"column": 19
}
}
}
]
},
{
"type": "ExpressionStatement",
"expression": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "describe",
"range": [
135,
143
],
"loc": {
"start": {
"line": 6,
"column": 0
},
"end": {
"line": 6,
"column": 8
}
}
},
"arguments": [
{
"type": "Literal",
"value": "Observable.prototype.scan",
"raw": "'Observable.prototype.scan'",
"range": [
144,
171
],
"loc": {
"start": {
"line": 6,
"column": 9
},
"end": {
"line": 6,
"column": 36
}
}
},
{
"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": "scan((acc, curr) => acc + curr, 0)",
"raw": "'scan((acc, curr) => acc + curr, 0)'",
"range": [
201,
237
],
"loc": {
"start": {
"line": 7,
"column": 14
},
"end": {
"line": 7,
"column": 50
}
}
}
],
"range": [
191,
238
],
"loc": {
"start": {
"line": 7,
"column": 4
},
"end": {
"line": 7,
"column": 51
}
}
},
"arguments": [
{
"type": "Literal",
"value": "should scan",
"raw": "'should scan'",
"range": [
239,
252
],
"loc": {
"start": {
"line": 7,
"column": 52
},
"end": {
"line": 7,
"column": 65
}
}
},
{
"type": "FunctionExpression",
"id": null,
"params": [],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "values",
"range": [
280,
286
],
"loc": {
"start": {
"line": 8,
"column": 12
},
"end": {
"line": 8,
"column": 18
}
}
},
"init": {
"type": "ObjectExpression",
"properties": [
{
"type": "Property",
"key": {
"type": "Identifier",
"name": "a",
"range": [
303,
304
],
"loc": {
"start": {
"line": 9,
"column": 12
},
"end": {
"line": 9,
"column": 13
}
}
},
"value": {
"type": "Literal",
"value": 1,
"raw": "1",
"range": [
306,
307
],
"loc": {
"start": {
"line": 9,
"column": 15
},
"end": {
"line": 9,
"column": 16
}
}
},
"kind": "init",
"method": false,
"shorthand": false,
"computed": false,
"range": [
303,
307
],
"loc": {
"start": {
"line": 9,
"column": 12
},
"end": {
"line": 9,
"column": 16
}
}
},
{
"type": "Property",
"key": {
"type": "Identifier",
"name": "b",
"range": [
309,
310
],
"loc": {
"start": {
"line": 9,
"column": 18
},
"end": {
"line": 9,
"column": 19
}
}
},
"value": {
"type": "Literal",
"value": 3,
"raw": "3",
"range": [
312,
313
],
"loc": {
"start": {
"line": 9,
"column": 21
},
"end": {
"line": 9,
"column": 22
}
}
},
"kind": "init",
"method": false,
"shorthand": false,
"computed": false,
"range": [
309,
313
],
"loc": {
"start": {
"line": 9,
"column": 18
},
"end": {
"line": 9,
"column": 22
}
}
},
{
"type": "Property",
"key": {
"type": "Identifier",
"name": "c",
"range": [
315,
316
],
"loc": {
"start": {
"line": 9,
"column": 24
},
"end": {
"line": 9,
"column": 25
}
}
},
"value": {
"type": "Literal",
"value": 5,
"raw": "5",
"range": [
318,
319
],
"loc": {
"start": {
"line": 9,
"column": 27
},
"end": {
"line": 9,
"column": 28
}
}
},
"kind": "init",
"method": false,
"shorthand": false,
"computed": false,
"range": [
315,
319
],
"loc": {
"start": {
"line": 9,
"column": 24
},
"end": {
"line": 9,
"column": 28
}
}
},
{
"type": "Property",
"key": {
"type": "Identifier",
"name": "x",
"range": [
333,
334
],
"loc": {
"start": {
"line": 10,
"column": 12
},
"end": {
"line": 10,
"column": 13
}
}
},
"value": {
"type": "Literal",
"value": 1,
"raw": "1",
"range": [
336,
337
],
"loc": {
"start": {
"line": 10,
"column": 15
},
"end": {
"line": 10,
"column": 16
}
}
},
"kind": "init",
"method": false,
"shorthand": false,
"computed": false,
"range": [
333,
337
],
"loc": {
"start": {
"line": 10,
"column": 12
},
"end": {
"line": 10,
"column": 16
}
}
},
{
"type": "Property",
"key": {
"type": "Identifier",
"name": "y",
"range": [
339,
340
],
"loc": {
"start": {
"line": 10,
"column": 18
},
"end": {
"line": 10,
"column": 19
}
}
},
"value": {
"type": "Literal",
"value": 4,
"raw": "4",
"range": [
342,
343
],
"loc": {
"start": {
"line": 10,
"column": 21
},
"end": {
"line": 10,
"column": 22
}
}
},
"kind": "init",
"method": false,
"shorthand": false,
"computed": false,
"range": [
339,
343
],
"loc": {
"start": {
"line": 10,
"column": 18
},
"end": {
"line": 10,
"column": 22
}
}
},
{
"type": "Property",
"key": {
"type": "Identifier",
"name": "z",
"range": [
345,
346
],
"loc": {
"start": {
"line": 10,
"column": 24
},
"end": {
"line": 10,
"column": 25
}
}
},
"value": {
"type": "Literal",
"value": 9,
"raw": "9",
"range": [
348,
349
],
"loc": {
"start": {
"line": 10,
"column": 27
},
"end": {
"line": 10,
"column": 28
}
}
},
"kind": "init",
"method": false,
"shorthand": false,
"computed": false,
"range": [
345,
349
],
"loc": {
"start": {
"line": 10,
"column": 24
},
"end": {
"line": 10,
"column": 28
}
}
}
],
"range": [
289,
359
],
"loc": {
"start": {
"line": 8,
"column": 21
},
"end": {
"line": 11,
"column": 9
}
}
},
"range": [
280,
359
],
"loc": {
"start": {
"line": 8,
"column": 12
},
"end": {
"line": 11,
"column": 9
}
}
}
],
"kind": "var",
"range": [
276,
360
],
"loc": {
"start": {
"line": 8,
"column": 8
},
"end": {
"line": 11,
"column": 10
}
}
},
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "e1",
"range": [
373,
375
],
"loc": {
"start": {
"line": 12,
"column": 12
},
"end": {
"line": 12,
"column": 14
}
}
},
"init": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "hot",
"range": [
378,
381
],
"loc": {
"start": {
"line": 12,
"column": 17
},
"end": {
"line": 12,
"column": 20
}
}
},
"arguments": [
{
"type": "Literal",
"value": "--a--b--c--|",
"raw": "'--a--b--c--|'",
"range": [
382,
396
],
"loc": {
"start": {
"line": 12,
"column": 21
},
"end": {
"line": 12,
"column": 35
}
}
},
{
"type": "Identifier",
"name": "values",
"range": [
398,
404
],
"loc": {
"start": {
"line": 12,
"column": 37
},
"end": {
"line": 12,
"column": 43
}
}
}
],
"range": [
378,
405
],
"loc": {
"start": {
"line": 12,
"column": 17
},
"end": {
"line": 12,
"column": 44
}
}
},
"range": [
373,
405
],
"loc": {
"start": {
"line": 12,
"column": 12
},
"end": {
"line": 12,
"column": 44
}
}
}
],
"kind": "var",
"range": [
369,
406
],
"loc": {
"start": {
"line": 12,
"column": 8
},
"end": {
"line": 12,
"column": 45
}
}
},
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "e1subs",
"range": [
419,
425
],
"loc": {
"start": {
"line": 13,
"column": 12
},
"end": {
"line": 13,
"column": 18
}
}
},
"init": {
"type": "Literal",
"value": "^ !",
"raw": "'^ !'",
"range": [
428,
442
],
"loc": {
"start": {
"line": 13,
"column": 21
},
"end": {
"line": 13,
"column": 35
}
}
},
"range": [
419,
442
],
"loc": {
"start": {
"line": 13,
"column": 12
},
"end": {
"line": 13,
"column": 35
}
}
}
],
"kind": "var",
"range": [
415,
443
],
"loc": {
"start": {
"line": 13,
"column": 8
},
"end": {
"line": 13,
"column": 36
}
}
},
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "expected",
"range": [
456,
464
],
"loc": {
"start": {
"line": 14,
"column": 12
},
"end": {
"line": 14,
"column": 20
}
}
},
"init": {
"type": "Literal",
"value": "--x--y--z--|",
"raw": "'--x--y--z--|'",
"range": [
467,
481
],
"loc": {
"start": {
"line": 14,
"column": 23
},
"end": {
"line": 14,
"column": 37
}
}
},
"range": [
456,
481
],
"loc": {
"start": {
"line": 14,
"column": 12
},
"end": {
"line": 14,
"column": 37
}
}
}
],
"kind": "var",
"range": [
452,
482
],
"loc": {
"start": {
"line": 14,
"column": 8
},
"end": {
"line": 14,
"column": 38
}
}
},
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "scanFunction",
"range": [
495,
507
],
"loc": {
"start": {
"line": 15,
"column": 12
},
"end": {
"line": 15,
"column": 24
}
}
},
"init": {
"type": "FunctionExpression",
"id": null,
"params": [
{
"type": "Identifier",
"name": "o",
"range": [
520,
521
],
"loc": {
"start": {
"line": 15,
"column": 37
},
"end": {
"line": 15,
"column": 38
}
}
},
{
"type": "Identifier",
"name": "x",
"range": [
523,
524
],
"loc": {
"start": {
"line": 15,
"column": 40
},
"end": {
"line": 15,
"column": 41
}
}
}
],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "ReturnStatement",
"argument": {
"type": "BinaryExpression",
"operator": "+",
"left": {
"type": "Identifier",
"name": "o",
"range": [