@reactivex/rxjs
Version:
Reactive Extensions for modern JavaScript
1,419 lines (1,418 loc) • 916 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": "test_helper_1",
"range": [
87,
100
],
"loc": {
"start": {
"line": 4,
"column": 4
},
"end": {
"line": 4,
"column": 17
}
}
},
"init": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "require",
"range": [
103,
110
],
"loc": {
"start": {
"line": 4,
"column": 20
},
"end": {
"line": 4,
"column": 27
}
}
},
"arguments": [
{
"type": "Literal",
"value": "../helpers/test-helper",
"raw": "'../helpers/test-helper'",
"range": [
111,
135
],
"loc": {
"start": {
"line": 4,
"column": 28
},
"end": {
"line": 4,
"column": 52
}
}
}
],
"range": [
103,
136
],
"loc": {
"start": {
"line": 4,
"column": 20
},
"end": {
"line": 4,
"column": 53
}
}
},
"range": [
87,
136
],
"loc": {
"start": {
"line": 4,
"column": 4
},
"end": {
"line": 4,
"column": 53
}
}
}
],
"kind": "var",
"range": [
83,
137
],
"loc": {
"start": {
"line": 4,
"column": 0
},
"end": {
"line": 4,
"column": 54
}
}
},
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "Observable",
"range": [
142,
152
],
"loc": {
"start": {
"line": 5,
"column": 4
},
"end": {
"line": 5,
"column": 14
}
}
},
"init": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "Identifier",
"name": "Rx",
"range": [
155,
157
],
"loc": {
"start": {
"line": 5,
"column": 17
},
"end": {
"line": 5,
"column": 19
}
}
},
"property": {
"type": "Identifier",
"name": "Observable",
"range": [
158,
168
],
"loc": {
"start": {
"line": 5,
"column": 20
},
"end": {
"line": 5,
"column": 30
}
}
},
"range": [
155,
168
],
"loc": {
"start": {
"line": 5,
"column": 17
},
"end": {
"line": 5,
"column": 30
}
}
},
"range": [
142,
168
],
"loc": {
"start": {
"line": 5,
"column": 4
},
"end": {
"line": 5,
"column": 30
}
}
}
],
"kind": "var",
"range": [
138,
169
],
"loc": {
"start": {
"line": 5,
"column": 0
},
"end": {
"line": 5,
"column": 31
}
},
"trailingComments": [
{
"type": "Block",
"value": "* @test {catch} ",
"range": [
170,
190
],
"loc": {
"start": {
"line": 6,
"column": 0
},
"end": {
"line": 6,
"column": 20
}
}
}
]
},
{
"type": "ExpressionStatement",
"expression": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "describe",
"range": [
191,
199
],
"loc": {
"start": {
"line": 7,
"column": 0
},
"end": {
"line": 7,
"column": 8
}
}
},
"arguments": [
{
"type": "Literal",
"value": "Observable.prototype.catch",
"raw": "'Observable.prototype.catch'",
"range": [
200,
228
],
"loc": {
"start": {
"line": 7,
"column": 9
},
"end": {
"line": 7,
"column": 37
}
}
},
{
"type": "FunctionExpression",
"id": null,
"params": [],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "CallExpression",
"callee": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "asDiagram",
"range": [
248,
257
],
"loc": {
"start": {
"line": 8,
"column": 4
},
"end": {
"line": 8,
"column": 13
}
}
},
"arguments": [
{
"type": "Literal",
"value": "catch",
"raw": "'catch'",
"range": [
258,
265
],
"loc": {
"start": {
"line": 8,
"column": 14
},
"end": {
"line": 8,
"column": 21
}
}
}
],
"range": [
248,
266
],
"loc": {
"start": {
"line": 8,
"column": 4
},
"end": {
"line": 8,
"column": 22
}
}
},
"arguments": [
{
"type": "Literal",
"value": "should catch error and replace with a cold Observable",
"raw": "'should catch error and replace with a cold Observable'",
"range": [
267,
322
],
"loc": {
"start": {
"line": 8,
"column": 23
},
"end": {
"line": 8,
"column": 78
}
}
},
{
"type": "FunctionExpression",
"id": null,
"params": [],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "e1",
"range": [
350,
352
],
"loc": {
"start": {
"line": 9,
"column": 12
},
"end": {
"line": 9,
"column": 14
}
}
},
"init": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "hot",
"range": [
355,
358
],
"loc": {
"start": {
"line": 9,
"column": 17
},
"end": {
"line": 9,
"column": 20
}
}
},
"arguments": [
{
"type": "Literal",
"value": "--a--b--# ",
"raw": "'--a--b--# '",
"range": [
359,
378
],
"loc": {
"start": {
"line": 9,
"column": 21
},
"end": {
"line": 9,
"column": 40
}
}
}
],
"range": [
355,
379
],
"loc": {
"start": {
"line": 9,
"column": 17
},
"end": {
"line": 9,
"column": 41
}
}
},
"range": [
350,
379
],
"loc": {
"start": {
"line": 9,
"column": 12
},
"end": {
"line": 9,
"column": 41
}
}
}
],
"kind": "var",
"range": [
346,
380
],
"loc": {
"start": {
"line": 9,
"column": 8
},
"end": {
"line": 9,
"column": 42
}
}
},
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "e2",
"range": [
393,
395
],
"loc": {
"start": {
"line": 10,
"column": 12
},
"end": {
"line": 10,
"column": 14
}
}
},
"init": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "cold",
"range": [
398,
402
],
"loc": {
"start": {
"line": 10,
"column": 17
},
"end": {
"line": 10,
"column": 21
}
}
},
"arguments": [
{
"type": "Literal",
"value": "-1-2-3-| ",
"raw": "'-1-2-3-| '",
"range": [
403,
422
],
"loc": {
"start": {
"line": 10,
"column": 22
},
"end": {
"line": 10,
"column": 41
}
}
}
],
"range": [
398,
423
],
"loc": {
"start": {
"line": 10,
"column": 17
},
"end": {
"line": 10,
"column": 42
}
}
},
"range": [
393,
423
],
"loc": {
"start": {
"line": 10,
"column": 12
},
"end": {
"line": 10,
"column": 42
}
}
}
],
"kind": "var",
"range": [
389,
424
],
"loc": {
"start": {
"line": 10,
"column": 8
},
"end": {
"line": 10,
"column": 43
}
}
},
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "expected",
"range": [
437,
445
],
"loc": {
"start": {
"line": 11,
"column": 12
},
"end": {
"line": 11,
"column": 20
}
}
},
"init": {
"type": "Literal",
"value": "--a--b---1-2-3-|)",
"raw": "'--a--b---1-2-3-|)'",
"range": [
448,
467
],
"loc": {
"start": {
"line": 11,
"column": 23
},
"end": {
"line": 11,
"column": 42
}
}
},
"range": [
437,
467
],
"loc": {
"start": {
"line": 11,
"column": 12
},
"end": {
"line": 11,
"column": 42
}
}
}
],
"kind": "var",
"range": [
433,
468
],
"loc": {
"start": {
"line": 11,
"column": 8
},
"end": {
"line": 11,
"column": 43
}
}
},
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "result",
"range": [
481,
487
],
"loc": {
"start": {
"line": 12,
"column": 12
},
"end": {
"line": 12,
"column": 18
}
}
},
"init": {
"type": "CallExpression",
"callee": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "Identifier",
"name": "e1",
"range": [
490,
492
],
"loc": {
"start": {
"line": 12,
"column": 21
},
"end": {
"line": 12,
"column": 23
}
}
},
"property": {
"type": "Identifier",
"name": "catch",
"range": [
493,
498
],
"loc": {
"start": {
"line": 12,
"column": 24
},
"end": {
"line": 12,
"column": 29
}
}
},
"range": [
490,
498
],
"loc": {
"start": {
"line": 12,
"column": 21
},
"end": {
"line": 12,
"column": 29
}
}
},
"arguments": [
{
"type": "FunctionExpression",
"id": null,
"params": [
{
"type": "Identifier",
"name": "err",
"range": [
509,
512
],
"loc": {
"start": {
"line": 12,
"column": 40
},
"end": {
"line": 12,
"column": 43
}
}
}
],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "ReturnStatement",
"argument": {
"type": "Identifier",
"name": "e2",
"range": [
523,
525
],
"loc": {
"start": {
"line": 12,
"column": 54
},
"end": {
"line": 12,
"column": 56
}
}
},
"range": [
516,
526
],
"loc": {
"start": {
"line": 12,
"column": 47
},
"end": {
"line": 12,
"column": 57
}
}
}
],
"range": [
514,
528
],
"loc": {
"start": {
"line": 12,
"column": 45
},
"end": {
"line": 12,
"column": 59
}
}
},
"generator": false,
"expression": false,
"range": [
499,
528
],
"loc": {
"start": {
"line": 12,
"column": 30
},
"end": {
"line": 12,
"column": 59
}
}
}
],
"range": [
490,
529
],
"loc": {
"start": {
"line": 12,
"column": 21
},
"end": {
"line": 12,
"column": 60
}
}
},
"range": [
481,
529
],
"loc": {
"start": {
"line": 12,
"column": 12
},
"end": {
"line": 12,
"column": 60
}
}
}
],
"kind": "var",
"range": [
477,
530
],
"loc": {
"start": {
"line": 12,
"column": 8
},
"end": {
"line": 12,
"column": 61
}
}
},
{
"type": "ExpressionStatement",
"expression": {
"type": "CallExpression",
"callee": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "expectObservable",
"range": [
539,
555
],
"loc": {
"start": {
"line": 13,
"column": 8
},
"end": {
"line": 13,
"column": 24
}
}
},
"arguments": [
{
"type": "Identifier",
"name": "result",
"range": [
556,
562
],
"loc": {
"start": {
"line": 13,
"column": 25
},
"end": {
"line": 13,
"column": 31
}
}
}
],
"range": [
539,
563
],
"loc": {
"start": {
"line": 13,
"column": 8
},
"end": {
"line": 13,
"column": 32
}
}
},
"property": {
"type": "Identifier",
"name": "toBe",
"range": [
564,
568
],
"loc": {
"start": {
"line": 13,
"column": 33
},
"end": {
"line": 13,
"column": 37
}
}
},
"range": [
539,
568
],
"loc": {
"start": {
"line": 13,
"column": 8
},
"end": {
"line": 13,
"column": 37
}
}
},
"arguments": [
{
"type": "Identifier",
"name": "expected",
"range": [
569,
577
],
"loc": {
"start": {
"line": 13,
"column": 38
},
"end": {
"line": 13,
"column": 46
}
}
}
],
"range": [
539,
578
],
"loc": {
"start": {
"line": 13,
"column": 8
},
"end": {
"line": 13,
"column": 47
}
}
},
"range": [
539,
579
],
"loc": {
"start": {
"line": 13,
"column": 8
},
"end": {
"line": 13,
"column": 48
}
}
}
],
"range": [
336,
585
],
"loc": {
"start": {
"line": 8,
"column": 92
},
"end": {
"line": 14,
"column": 5
}
}
},
"generator": false,
"expression": false,
"range": [
324,
585
],
"loc": {
"start": {
"line": 8,
"column": 80
},
"end": {
"line": 14,
"column": 5
}
}
}
],
"range": [
248,
586
],
"loc": {
"start": {
"line": 8,
"column": 4
},
"end": {
"line": 14,
"column": 6
}
}
},
"range": [
248,
587
],
"loc": {
"start": {
"line": 8,
"column": 4
},
"end": {
"line": 14,
"column": 7
}
}
},
{
"type": "ExpressionStatement",
"expression": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "it",
"range": [
592,
594
],
"loc": {
"start": {
"line": 15,
"column": 4
},
"end": {
"line": 15,
"column": 6
}
}
},
"arguments": [
{
"type": "Literal",
"value": "should catch error and replace it with Observable.of()",
"raw": "'should catch error and replace it with Observable.of()'",
"range": [
595,
651
],
"loc": {
"start": {
"line": 15,
"column": 7
},
"end": {
"line": 15,
"column": 63
}
}
},
{
"type": "FunctionExpression",
"id": null,
"params": [],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",