@reactivex/rxjs
Version:
Reactive Extensions for modern JavaScript
1,414 lines (1,413 loc) • 167 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": "ErrorObservable_1",
"range": [
87,
104
],
"loc": {
"start": {
"line": 4,
"column": 4
},
"end": {
"line": 4,
"column": 21
}
}
},
"init": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "require",
"range": [
107,
114
],
"loc": {
"start": {
"line": 4,
"column": 24
},
"end": {
"line": 4,
"column": 31
}
}
},
"arguments": [
{
"type": "Literal",
"value": "../../dist/cjs/observable/ErrorObservable",
"raw": "'../../dist/cjs/observable/ErrorObservable'",
"range": [
115,
158
],
"loc": {
"start": {
"line": 4,
"column": 32
},
"end": {
"line": 4,
"column": 75
}
}
}
],
"range": [
107,
159
],
"loc": {
"start": {
"line": 4,
"column": 24
},
"end": {
"line": 4,
"column": 76
}
}
},
"range": [
87,
159
],
"loc": {
"start": {
"line": 4,
"column": 4
},
"end": {
"line": 4,
"column": 76
}
}
}
],
"kind": "var",
"range": [
83,
160
],
"loc": {
"start": {
"line": 4,
"column": 0
},
"end": {
"line": 4,
"column": 77
}
}
},
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "Observable",
"range": [
165,
175
],
"loc": {
"start": {
"line": 5,
"column": 4
},
"end": {
"line": 5,
"column": 14
}
}
},
"init": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "Identifier",
"name": "Rx",
"range": [
178,
180
],
"loc": {
"start": {
"line": 5,
"column": 17
},
"end": {
"line": 5,
"column": 19
}
}
},
"property": {
"type": "Identifier",
"name": "Observable",
"range": [
181,
191
],
"loc": {
"start": {
"line": 5,
"column": 20
},
"end": {
"line": 5,
"column": 30
}
}
},
"range": [
178,
191
],
"loc": {
"start": {
"line": 5,
"column": 17
},
"end": {
"line": 5,
"column": 30
}
}
},
"range": [
165,
191
],
"loc": {
"start": {
"line": 5,
"column": 4
},
"end": {
"line": 5,
"column": 30
}
}
}
],
"kind": "var",
"range": [
161,
192
],
"loc": {
"start": {
"line": 5,
"column": 0
},
"end": {
"line": 5,
"column": 31
}
},
"trailingComments": [
{
"type": "Block",
"value": "* @test {throw} ",
"range": [
193,
213
],
"loc": {
"start": {
"line": 6,
"column": 0
},
"end": {
"line": 6,
"column": 20
}
}
}
]
},
{
"type": "ExpressionStatement",
"expression": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "describe",
"range": [
214,
222
],
"loc": {
"start": {
"line": 7,
"column": 0
},
"end": {
"line": 7,
"column": 8
}
}
},
"arguments": [
{
"type": "Literal",
"value": "Observable.throw",
"raw": "'Observable.throw'",
"range": [
223,
241
],
"loc": {
"start": {
"line": 7,
"column": 9
},
"end": {
"line": 7,
"column": 27
}
}
},
{
"type": "FunctionExpression",
"id": null,
"params": [],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "CallExpression",
"callee": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "asDiagram",
"range": [
261,
270
],
"loc": {
"start": {
"line": 8,
"column": 4
},
"end": {
"line": 8,
"column": 13
}
}
},
"arguments": [
{
"type": "Literal",
"value": "throw(e)",
"raw": "'throw(e)'",
"range": [
271,
281
],
"loc": {
"start": {
"line": 8,
"column": 14
},
"end": {
"line": 8,
"column": 24
}
}
}
],
"range": [
261,
282
],
"loc": {
"start": {
"line": 8,
"column": 4
},
"end": {
"line": 8,
"column": 25
}
}
},
"arguments": [
{
"type": "Literal",
"value": "should create a cold observable that just emits an error",
"raw": "'should create a cold observable that just emits an error'",
"range": [
283,
341
],
"loc": {
"start": {
"line": 8,
"column": 26
},
"end": {
"line": 8,
"column": 84
}
}
},
{
"type": "FunctionExpression",
"id": null,
"params": [],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "expected",
"range": [
369,
377
],
"loc": {
"start": {
"line": 9,
"column": 12
},
"end": {
"line": 9,
"column": 20
}
}
},
"init": {
"type": "Literal",
"value": "#",
"raw": "'#'",
"range": [
380,
383
],
"loc": {
"start": {
"line": 9,
"column": 23
},
"end": {
"line": 9,
"column": 26
}
}
},
"range": [
369,
383
],
"loc": {
"start": {
"line": 9,
"column": 12
},
"end": {
"line": 9,
"column": 26
}
}
}
],
"kind": "var",
"range": [
365,
384
],
"loc": {
"start": {
"line": 9,
"column": 8
},
"end": {
"line": 9,
"column": 27
}
}
},
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "e1",
"range": [
397,
399
],
"loc": {
"start": {
"line": 10,
"column": 12
},
"end": {
"line": 10,
"column": 14
}
}
},
"init": {
"type": "CallExpression",
"callee": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "Identifier",
"name": "Observable",
"range": [
402,
412
],
"loc": {
"start": {
"line": 10,
"column": 17
},
"end": {
"line": 10,
"column": 27
}
}
},
"property": {
"type": "Identifier",
"name": "throw",
"range": [
413,
418
],
"loc": {
"start": {
"line": 10,
"column": 28
},
"end": {
"line": 10,
"column": 33
}
}
},
"range": [
402,
418
],
"loc": {
"start": {
"line": 10,
"column": 17
},
"end": {
"line": 10,
"column": 33
}
}
},
"arguments": [
{
"type": "Literal",
"value": "error",
"raw": "'error'",
"range": [
419,
426
],
"loc": {
"start": {
"line": 10,
"column": 34
},
"end": {
"line": 10,
"column": 41
}
}
}
],
"range": [
402,
427
],
"loc": {
"start": {
"line": 10,
"column": 17
},
"end": {
"line": 10,
"column": 42
}
}
},
"range": [
397,
427
],
"loc": {
"start": {
"line": 10,
"column": 12
},
"end": {
"line": 10,
"column": 42
}
}
}
],
"kind": "var",
"range": [
393,
428
],
"loc": {
"start": {
"line": 10,
"column": 8
},
"end": {
"line": 10,
"column": 43
}
}
},
{
"type": "ExpressionStatement",
"expression": {
"type": "CallExpression",
"callee": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "expectObservable",
"range": [
437,
453
],
"loc": {
"start": {
"line": 11,
"column": 8
},
"end": {
"line": 11,
"column": 24
}
}
},
"arguments": [
{
"type": "Identifier",
"name": "e1",
"range": [
454,
456
],
"loc": {
"start": {
"line": 11,
"column": 25
},
"end": {
"line": 11,
"column": 27
}
}
}
],
"range": [
437,
457
],
"loc": {
"start": {
"line": 11,
"column": 8
},
"end": {
"line": 11,
"column": 28
}
}
},
"property": {
"type": "Identifier",
"name": "toBe",
"range": [
458,
462
],
"loc": {
"start": {
"line": 11,
"column": 29
},
"end": {
"line": 11,
"column": 33
}
}
},
"range": [
437,
462
],
"loc": {
"start": {
"line": 11,
"column": 8
},
"end": {
"line": 11,
"column": 33
}
}
},
"arguments": [
{
"type": "Identifier",
"name": "expected",
"range": [
463,
471
],
"loc": {
"start": {
"line": 11,
"column": 34
},
"end": {
"line": 11,
"column": 42
}
}
}
],
"range": [
437,
472
],
"loc": {
"start": {
"line": 11,
"column": 8
},
"end": {
"line": 11,
"column": 43
}
}
},
"range": [
437,
473
],
"loc": {
"start": {
"line": 11,
"column": 8
},
"end": {
"line": 11,
"column": 44
}
}
}
],
"range": [
355,
479
],
"loc": {
"start": {
"line": 8,
"column": 98
},
"end": {
"line": 12,
"column": 5
}
}
},
"generator": false,
"expression": false,
"range": [
343,
479
],
"loc": {
"start": {
"line": 8,
"column": 86
},
"end": {
"line": 12,
"column": 5
}
}
}
],
"range": [
261,
480
],
"loc": {
"start": {
"line": 8,
"column": 4
},
"end": {
"line": 12,
"column": 6
}
}
},
"range": [
261,
481
],
"loc": {
"start": {
"line": 8,
"column": 4
},
"end": {
"line": 12,
"column": 7
}
}
},
{
"type": "ExpressionStatement",
"expression": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "it",
"range": [
486,
488
],
"loc": {
"start": {
"line": 13,
"column": 4
},
"end": {
"line": 13,
"column": 6
}
}
},
"arguments": [
{
"type": "Literal",
"value": "should emit one value",
"raw": "'should emit one value'",
"range": [
489,
512
],
"loc": {
"start": {
"line": 13,
"column": 7
},
"end": {
"line": 13,
"column": 30
}
}
},
{
"type": "FunctionExpression",
"id": null,
"params": [
{
"type": "Identifier",
"name": "done",
"range": [
524,
528
],
"loc": {
"start": {
"line": 13,
"column": 42
},
"end": {
"line": 13,
"column": 46
}
}
}
],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "calls",
"range": [
544,
549
],
"loc": {
"start": {
"line": 14,
"column": 12
},
"end": {
"line": 14,
"column": 17
}
}
},
"init": {
"type": "Literal",
"value": 0,
"raw": "0",
"range": [
552,
553
],
"loc": {
"start": {
"line": 14,
"column": 20
},
"end": {
"line": 14,
"column": 21
}
}
},
"range": [
544,
553
],
"loc": {
"start": {
"line": 14,
"column": 12
},
"end": {
"line": 14,
"column": 21
}
}
}
],
"kind": "var",
"range": [
540,
554
],
"loc": {
"start": {
"line": 14,
"column": 8
},
"end": {
"line": 14,
"column": 22
}
}
},
{
"type": "ExpressionStatement",
"expression": {
"type": "CallExpression",
"callee": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "CallExpression",
"callee": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "Identifier",
"name": "Observable",
"range": [
563,
573
],
"loc": {
"start": {
"line": 15,
"column": 8
},
"end": {
"line": 15,
"column": 18
}
}
},
"property": {
"type": "Identifier",
"name": "throw",
"range": [
574,
579
],
"loc": {
"start": {
"line": 15,
"column": 19
},
"end": {
"line": 15,
"column": 24
}
}
},
"range": [
563,
579
],
"loc": {
"start": {
"line": 15,
"column": 8
},
"end": {
"line": 15,
"column": 24
}
}
},
"arguments": [
{
"type": "Literal",
"value": "bad",
"raw": "'bad'",
"range": [
580,
585
],
"loc": {
"start": {
"line": 15,
"column": 25
},
"end": {
"line": 15,
"column": 30
}
}
}
],
"range": [
563,
586
],
"loc": {
"start": {
"line": 15,
"column": 8
},
"end": {
"line": 15,
"column": 31
}
}
},
"property": {
"type": "Identifier",
"name": "subscribe",
"range": [
587,
596
],
"loc": {
"start": {
"line": 15,
"column": 32
},
"end": {
"line": 15,
"column": 41
}
}
},
"range": [
563,
596
],
"loc": {
"start": {
"line": 15,
"column": 8
},
"end": {
"line": 15,
"column": 41
}
}
},
"arguments": [
{
"type": "FunctionExpression",
"id": null,
"params": [],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "done",
"range": [
623,
627
],
"loc": {
"start": {
"line": 16,
"column": 12
},
"end": {
"line": 16,
"column": 16
}
}
},
"arguments": [
{
"type": "NewExpression",
"callee": {
"type": "Identifier",
"name": "Error",
"range": [
632,
637
],
"loc": {
"start": {
"line": 16,
"column": 21
},
"end": {
"line": 16,
"column": 26
}
}
},
"arguments": [
{
"type": "Literal",
"value": "should not be called",
"raw": "'should not be called'",
"range": [
638,
660
],
"loc": {
"start": {
"line": 16,
"column": 27
},
"end": {
"line": 16,
"column": 49
}
}
}
],