@reactivex/rxjs
Version:
Reactive Extensions for modern JavaScript
1,272 lines • 177 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 {toPromise} ",
"range": [
115,
139
],
"loc": {
"start": {
"line": 5,
"column": 0
},
"end": {
"line": 5,
"column": 24
}
}
}
]
},
{
"type": "ExpressionStatement",
"expression": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "describe",
"range": [
140,
148
],
"loc": {
"start": {
"line": 6,
"column": 0
},
"end": {
"line": 6,
"column": 8
}
}
},
"arguments": [
{
"type": "Literal",
"value": "Observable.prototype.toPromise",
"raw": "'Observable.prototype.toPromise'",
"range": [
149,
181
],
"loc": {
"start": {
"line": 6,
"column": 9
},
"end": {
"line": 6,
"column": 41
}
}
},
{
"type": "FunctionExpression",
"id": null,
"params": [],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "it",
"range": [
201,
203
],
"loc": {
"start": {
"line": 7,
"column": 4
},
"end": {
"line": 7,
"column": 6
}
}
},
"arguments": [
{
"type": "Literal",
"value": "should convert an Observable to a promise of its last value",
"raw": "'should convert an Observable to a promise of its last value'",
"range": [
204,
265
],
"loc": {
"start": {
"line": 7,
"column": 7
},
"end": {
"line": 7,
"column": 68
}
}
},
{
"type": "FunctionExpression",
"id": null,
"params": [
{
"type": "Identifier",
"name": "done",
"range": [
277,
281
],
"loc": {
"start": {
"line": 7,
"column": 80
},
"end": {
"line": 7,
"column": 84
}
}
}
],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "CallExpression",
"callee": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "CallExpression",
"callee": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "CallExpression",
"callee": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "Identifier",
"name": "Observable",
"range": [
293,
303
],
"loc": {
"start": {
"line": 8,
"column": 8
},
"end": {
"line": 8,
"column": 18
}
}
},
"property": {
"type": "Identifier",
"name": "of",
"range": [
304,
306
],
"loc": {
"start": {
"line": 8,
"column": 19
},
"end": {
"line": 8,
"column": 21
}
}
},
"range": [
293,
306
],
"loc": {
"start": {
"line": 8,
"column": 8
},
"end": {
"line": 8,
"column": 21
}
}
},
"arguments": [
{
"type": "Literal",
"value": 1,
"raw": "1",
"range": [
307,
308
],
"loc": {
"start": {
"line": 8,
"column": 22
},
"end": {
"line": 8,
"column": 23
}
}
},
{
"type": "Literal",
"value": 2,
"raw": "2",
"range": [
310,
311
],
"loc": {
"start": {
"line": 8,
"column": 25
},
"end": {
"line": 8,
"column": 26
}
}
},
{
"type": "Literal",
"value": 3,
"raw": "3",
"range": [
313,
314
],
"loc": {
"start": {
"line": 8,
"column": 28
},
"end": {
"line": 8,
"column": 29
}
}
}
],
"range": [
293,
315
],
"loc": {
"start": {
"line": 8,
"column": 8
},
"end": {
"line": 8,
"column": 30
}
}
},
"property": {
"type": "Identifier",
"name": "toPromise",
"range": [
316,
325
],
"loc": {
"start": {
"line": 8,
"column": 31
},
"end": {
"line": 8,
"column": 40
}
}
},
"range": [
293,
325
],
"loc": {
"start": {
"line": 8,
"column": 8
},
"end": {
"line": 8,
"column": 40
}
}
},
"arguments": [
{
"type": "Identifier",
"name": "Promise",
"range": [
326,
333
],
"loc": {
"start": {
"line": 8,
"column": 41
},
"end": {
"line": 8,
"column": 48
}
}
}
],
"range": [
293,
334
],
"loc": {
"start": {
"line": 8,
"column": 8
},
"end": {
"line": 8,
"column": 49
}
}
},
"property": {
"type": "Identifier",
"name": "then",
"range": [
335,
339
],
"loc": {
"start": {
"line": 8,
"column": 50
},
"end": {
"line": 8,
"column": 54
}
}
},
"range": [
293,
339
],
"loc": {
"start": {
"line": 8,
"column": 8
},
"end": {
"line": 8,
"column": 54
}
}
},
"arguments": [
{
"type": "FunctionExpression",
"id": null,
"params": [
{
"type": "Identifier",
"name": "x",
"range": [
350,
351
],
"loc": {
"start": {
"line": 8,
"column": 65
},
"end": {
"line": 8,
"column": 66
}
}
}
],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "CallExpression",
"callee": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "CallExpression",
"callee": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "Identifier",
"name": "chai_1",
"range": [
367,
373
],
"loc": {
"start": {
"line": 9,
"column": 12
},
"end": {
"line": 9,
"column": 18
}
}
},
"property": {
"type": "Identifier",
"name": "expect",
"range": [
374,
380
],
"loc": {
"start": {
"line": 9,
"column": 19
},
"end": {
"line": 9,
"column": 25
}
}
},
"range": [
367,
380
],
"loc": {
"start": {
"line": 9,
"column": 12
},
"end": {
"line": 9,
"column": 25
}
}
},
"arguments": [
{
"type": "Identifier",
"name": "x",
"range": [
381,
382
],
"loc": {
"start": {
"line": 9,
"column": 26
},
"end": {
"line": 9,
"column": 27
}
}
}
],
"range": [
367,
383
],
"loc": {
"start": {
"line": 9,
"column": 12
},
"end": {
"line": 9,
"column": 28
}
}
},
"property": {
"type": "Identifier",
"name": "to",
"range": [
384,
386
],
"loc": {
"start": {
"line": 9,
"column": 29
},
"end": {
"line": 9,
"column": 31
}
}
},
"range": [
367,
386
],
"loc": {
"start": {
"line": 9,
"column": 12
},
"end": {
"line": 9,
"column": 31
}
}
},
"property": {
"type": "Identifier",
"name": "equal",
"range": [
387,
392
],
"loc": {
"start": {
"line": 9,
"column": 32
},
"end": {
"line": 9,
"column": 37
}
}
},
"range": [
367,
392
],
"loc": {
"start": {
"line": 9,
"column": 12
},
"end": {
"line": 9,
"column": 37
}
}
},
"arguments": [
{
"type": "Literal",
"value": 3,
"raw": "3",
"range": [
393,
394
],
"loc": {
"start": {
"line": 9,
"column": 38
},
"end": {
"line": 9,
"column": 39
}
}
}
],
"range": [
367,
395
],
"loc": {
"start": {
"line": 9,
"column": 12
},
"end": {
"line": 9,
"column": 40
}
}
},
"range": [
367,
396
],
"loc": {
"start": {
"line": 9,
"column": 12
},
"end": {
"line": 9,
"column": 41
}
}
},
{
"type": "ExpressionStatement",
"expression": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "done",
"range": [
409,
413
],
"loc": {
"start": {
"line": 10,
"column": 12
},
"end": {
"line": 10,
"column": 16
}
}
},
"arguments": [],
"range": [
409,
415
],
"loc": {
"start": {
"line": 10,
"column": 12
},
"end": {
"line": 10,
"column": 18
}
}
},
"range": [
409,
416
],
"loc": {
"start": {
"line": 10,
"column": 12
},
"end": {
"line": 10,
"column": 19
}
}
}
],
"range": [
353,
426
],
"loc": {
"start": {
"line": 8,
"column": 68
},
"end": {
"line": 11,
"column": 9
}
}
},
"generator": false,
"expression": false,
"range": [
340,
426
],
"loc": {
"start": {
"line": 8,
"column": 55
},
"end": {
"line": 11,
"column": 9
}
}
}
],
"range": [
293,
427
],
"loc": {
"start": {
"line": 8,
"column": 8
},
"end": {
"line": 11,
"column": 10
}
}
},
"range": [
293,
428
],
"loc": {
"start": {
"line": 8,
"column": 8
},
"end": {
"line": 11,
"column": 11
}
}
}
],
"range": [
283,
434
],
"loc": {
"start": {
"line": 7,
"column": 86
},
"end": {
"line": 12,
"column": 5
}
}
},
"generator": false,
"expression": false,
"range": [
267,
434
],
"loc": {
"start": {
"line": 7,
"column": 70
},
"end": {
"line": 12,
"column": 5
}
}
}
],
"range": [
201,
435
],
"loc": {
"start": {
"line": 7,
"column": 4
},
"end": {
"line": 12,
"column": 6
}
},
"_esdocTestId": 2156,
"_esdocTestName": "it2156"
},
"range": [
201,
436
],
"loc": {
"start": {
"line": 7,
"column": 4
},
"end": {
"line": 12,
"column": 7
}
}
},
{
"type": "ExpressionStatement",
"expression": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "it",
"range": [
441,
443
],
"loc": {
"start": {
"line": 13,
"column": 4
},
"end": {
"line": 13,
"column": 6
}
}
},
"arguments": [
{
"type": "Literal",
"value": "should handle errors properly",
"raw": "'should handle errors properly'",
"range": [
444,
475
],
"loc": {
"start": {
"line": 13,
"column": 7
},
"end": {
"line": 13,
"column": 38
}
}
},
{
"type": "FunctionExpression",
"id": null,
"params": [
{
"type": "Identifier",
"name": "done",
"range": [
487,
491
],
"loc": {
"start": {
"line": 13,
"column": 50
},
"end": {
"line": 13,
"column": 54
}
}
}
],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "CallExpression",
"callee": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "CallExpression",
"callee": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "CallExpression",
"callee": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "Identifier",
"name": "Observable",
"range": [
503,
513
],
"loc": {
"star