@reactivex/rxjs
Version:
Reactive Extensions for modern JavaScript
1,294 lines (1,293 loc) • 889 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": "sinon",
"range": [
48,
53
],
"loc": {
"start": {
"line": 3,
"column": 4
},
"end": {
"line": 3,
"column": 9
}
}
},
"init": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "require",
"range": [
56,
63
],
"loc": {
"start": {
"line": 3,
"column": 12
},
"end": {
"line": 3,
"column": 19
}
}
},
"arguments": [
{
"type": "Literal",
"value": "sinon",
"raw": "'sinon'",
"range": [
64,
71
],
"loc": {
"start": {
"line": 3,
"column": 20
},
"end": {
"line": 3,
"column": 27
}
}
}
],
"range": [
56,
72
],
"loc": {
"start": {
"line": 3,
"column": 12
},
"end": {
"line": 3,
"column": 28
}
}
},
"range": [
48,
72
],
"loc": {
"start": {
"line": 3,
"column": 4
},
"end": {
"line": 3,
"column": 28
}
}
}
],
"kind": "var",
"range": [
44,
73
],
"loc": {
"start": {
"line": 3,
"column": 0
},
"end": {
"line": 3,
"column": 29
}
}
},
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "Rx",
"range": [
78,
80
],
"loc": {
"start": {
"line": 4,
"column": 4
},
"end": {
"line": 4,
"column": 6
}
}
},
"init": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "require",
"range": [
83,
90
],
"loc": {
"start": {
"line": 4,
"column": 9
},
"end": {
"line": 4,
"column": 16
}
}
},
"arguments": [
{
"type": "Literal",
"value": "../../dist/cjs/Rx",
"raw": "'../../dist/cjs/Rx'",
"range": [
91,
110
],
"loc": {
"start": {
"line": 4,
"column": 17
},
"end": {
"line": 4,
"column": 36
}
}
}
],
"range": [
83,
111
],
"loc": {
"start": {
"line": 4,
"column": 9
},
"end": {
"line": 4,
"column": 37
}
}
},
"range": [
78,
111
],
"loc": {
"start": {
"line": 4,
"column": 4
},
"end": {
"line": 4,
"column": 37
}
}
}
],
"kind": "var",
"range": [
74,
112
],
"loc": {
"start": {
"line": 4,
"column": 0
},
"end": {
"line": 4,
"column": 38
}
}
},
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "Observable",
"range": [
117,
127
],
"loc": {
"start": {
"line": 5,
"column": 4
},
"end": {
"line": 5,
"column": 14
}
}
},
"init": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "Identifier",
"name": "Rx",
"range": [
130,
132
],
"loc": {
"start": {
"line": 5,
"column": 17
},
"end": {
"line": 5,
"column": 19
}
}
},
"property": {
"type": "Identifier",
"name": "Observable",
"range": [
133,
143
],
"loc": {
"start": {
"line": 5,
"column": 20
},
"end": {
"line": 5,
"column": 30
}
}
},
"range": [
130,
143
],
"loc": {
"start": {
"line": 5,
"column": 17
},
"end": {
"line": 5,
"column": 30
}
}
},
"range": [
117,
143
],
"loc": {
"start": {
"line": 5,
"column": 4
},
"end": {
"line": 5,
"column": 30
}
}
}
],
"kind": "var",
"range": [
113,
144
],
"loc": {
"start": {
"line": 5,
"column": 0
},
"end": {
"line": 5,
"column": 31
}
},
"trailingComments": [
{
"type": "Block",
"value": "* @test {fromPromise} ",
"range": [
145,
171
],
"loc": {
"start": {
"line": 6,
"column": 0
},
"end": {
"line": 6,
"column": 26
}
}
}
]
},
{
"type": "ExpressionStatement",
"expression": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "describe",
"range": [
172,
180
],
"loc": {
"start": {
"line": 7,
"column": 0
},
"end": {
"line": 7,
"column": 8
}
}
},
"arguments": [
{
"type": "Literal",
"value": "Observable.fromPromise",
"raw": "'Observable.fromPromise'",
"range": [
181,
205
],
"loc": {
"start": {
"line": 7,
"column": 9
},
"end": {
"line": 7,
"column": 33
}
}
},
{
"type": "FunctionExpression",
"id": null,
"params": [],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "it",
"range": [
225,
227
],
"loc": {
"start": {
"line": 8,
"column": 4
},
"end": {
"line": 8,
"column": 6
}
}
},
"arguments": [
{
"type": "Literal",
"value": "should emit one value from a resolved promise",
"raw": "'should emit one value from a resolved promise'",
"range": [
228,
275
],
"loc": {
"start": {
"line": 8,
"column": 7
},
"end": {
"line": 8,
"column": 54
}
}
},
{
"type": "FunctionExpression",
"id": null,
"params": [
{
"type": "Identifier",
"name": "done",
"range": [
287,
291
],
"loc": {
"start": {
"line": 8,
"column": 66
},
"end": {
"line": 8,
"column": 70
}
}
}
],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "promise",
"range": [
307,
314
],
"loc": {
"start": {
"line": 9,
"column": 12
},
"end": {
"line": 9,
"column": 19
}
}
},
"init": {
"type": "CallExpression",
"callee": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "Identifier",
"name": "Promise",
"range": [
317,
324
],
"loc": {
"start": {
"line": 9,
"column": 22
},
"end": {
"line": 9,
"column": 29
}
}
},
"property": {
"type": "Identifier",
"name": "resolve",
"range": [
325,
332
],
"loc": {
"start": {
"line": 9,
"column": 30
},
"end": {
"line": 9,
"column": 37
}
}
},
"range": [
317,
332
],
"loc": {
"start": {
"line": 9,
"column": 22
},
"end": {
"line": 9,
"column": 37
}
}
},
"arguments": [
{
"type": "Literal",
"value": 42,
"raw": "42",
"range": [
333,
335
],
"loc": {
"start": {
"line": 9,
"column": 38
},
"end": {
"line": 9,
"column": 40
}
}
}
],
"range": [
317,
336
],
"loc": {
"start": {
"line": 9,
"column": 22
},
"end": {
"line": 9,
"column": 41
}
}
},
"range": [
307,
336
],
"loc": {
"start": {
"line": 9,
"column": 12
},
"end": {
"line": 9,
"column": 41
}
}
}
],
"kind": "var",
"range": [
303,
337
],
"loc": {
"start": {
"line": 9,
"column": 8
},
"end": {
"line": 9,
"column": 42
}
}
},
{
"type": "ExpressionStatement",
"expression": {
"type": "CallExpression",
"callee": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "CallExpression",
"callee": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "Identifier",
"name": "Observable",
"range": [
346,
356
],
"loc": {
"start": {
"line": 10,
"column": 8
},
"end": {
"line": 10,
"column": 18
}
}
},
"property": {
"type": "Identifier",
"name": "fromPromise",
"range": [
357,
368
],
"loc": {
"start": {
"line": 10,
"column": 19
},
"end": {
"line": 10,
"column": 30
}
}
},
"range": [
346,
368
],
"loc": {
"start": {
"line": 10,
"column": 8
},
"end": {
"line": 10,
"column": 30
}
}
},
"arguments": [
{
"type": "Identifier",
"name": "promise",
"range": [
369,
376
],
"loc": {
"start": {
"line": 10,
"column": 31
},
"end": {
"line": 10,
"column": 38
}
}
}
],
"range": [
346,
377
],
"loc": {
"start": {
"line": 10,
"column": 8
},
"end": {
"line": 10,
"column": 39
}
}
},
"property": {
"type": "Identifier",
"name": "subscribe",
"range": [
391,
400
],
"loc": {
"start": {
"line": 11,
"column": 13
},
"end": {
"line": 11,
"column": 22
}
}
},
"range": [
346,
400
],
"loc": {
"start": {
"line": 10,
"column": 8
},
"end": {
"line": 11,
"column": 22
}
}
},
"arguments": [
{
"type": "FunctionExpression",
"id": null,
"params": [
{
"type": "Identifier",
"name": "x",
"range": [
411,
412
],
"loc": {
"start": {
"line": 11,
"column": 33
},
"end": {
"line": 11,
"column": 34
}
}
}
],
"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": [
416,
422
],
"loc": {
"start": {
"line": 11,
"column": 38
},
"end": {
"line": 11,
"column": 44
}
}
},
"property": {
"type": "Identifier",
"name": "expect",
"range": [
423,
429
],
"loc": {
"start": {
"line": 11,
"column": 45
},
"end": {
"line": 11,
"column": 51
}
}
},
"range": [
416,
429
],
"loc": {
"start": {
"line": 11,
"column": 38
},
"end": {
"line": 11,
"column": 51
}
}
},
"arguments": [
{
"type": "Identifier",
"name": "x",
"range": [
430,
431
],
"loc": {
"start": {
"line": 11,
"column": 52
},
"end": {
"line": 11,
"column": 53
}
}
}
],
"range": [
416,
432
],
"loc": {
"start": {
"line": 11,
"column": 38
},
"end": {
"line": 11,
"column": 54
}
}
},
"property": {
"type": "Identifier",
"name": "to",
"range": [
433,
435
],
"loc": {
"start": {
"line": 11,
"column": 55
},
"end": {
"line": 11,
"column": 57
}
}
},
"range": [
416,
435
],
"loc": {
"start": {
"line": 11,
"column": 38
},
"end": {
"line": 11,
"column": 57
}
}
},
"property": {
"type": "Identifier",
"name": "equal",
"range": [
436,
441
],
"loc": {
"start": {
"line": 11,
"column": 58
},
"end": {
"line": 11,
"column": 63
}
}
},
"range": [
416,
441
],
"loc": {
"start": {
"line": 11,
"column": 38
},
"end": {
"line": 11,
"column": 63
}
}
},
"arguments": [
{
"type": "Literal",
"value": 42,
"raw": "42",
"range": [
442,
444
],
"loc": {
"start": {
"line": 11,
"column": 64
},
"end": {
"line": 11,
"column": 66
}
}
}
],
"range": [
416,
445
],
"loc": {
"start": {
"line": 11,
"column": 38
},
"end": {
"line": 11,
"column": 67
}
}
},
"range": [
416,
446
],
"loc": {
"start": {
"line": 11,
"column": 38
},
"end": {
"line": 11,
"column": 68
}
}
}
],
"range": [
414,
448
],
"loc": {
"start": {
"line": 11,
"column": 36
},
"end": {
"line": 11,
"column": 70
}
}
},
"generator": false,
"expression": false,
"range": [
401,
448
],
"loc": {
"start": {
"line": 11,
"column": 23
},
"end": {
"line": 11,
"column": 70
}
}
},
{
"type": "FunctionExpression",
"id": null,
"params": [
{
"type": "Identifier",
"name": "x",
"range": [
460,
461
],
"loc": {
"start": {
"line": 11,
"column": 82
},
"end": {
"line": 11,
"column": 83
}
}
}
],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "done",
"range": [
477,
481
],
"loc": {
"start": {
"line": 12,
"column": 12
},
"end": {
"line": 12,
"column": 16
}
}
},
"arguments": [
{
"type": "NewExpression",
"callee": {
"type": "Identifier",
"name": "Error",
"range": [
486,
491
],
"loc": {
"start": {
"line": 12,
"column": 21
},
"end": {
"line": 12,
"column": 26
}
}
},
"arguments": [
{
"type": "Literal",
"value": "should not be called",
"raw": "'should not be called'",
"range": [
492,
514
],
"loc": {
"start": {
"line": 12,
"column": 27
},
"end": {
"line": 12,
"column": 49
}
}
}
],
"range": [
482,
515
],
"loc": {
"start": {
"line": 12,
"column": 17
},
"end": {
"line": 12,
"column": 50
}
}
}
],
"range": [
477,
516
],
"loc": {
"start": {
"line": 12,
"column": 12
},
"end": {
"line": 12,
"column": 51
}