@reactivex/rxjs
Version:
Reactive Extensions for modern JavaScript
1,376 lines (1,375 loc) • 1.32 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 {share} ",
"range": [
115,
135
],
"loc": {
"start": {
"line": 5,
"column": 0
},
"end": {
"line": 5,
"column": 20
}
}
}
]
},
{
"type": "ExpressionStatement",
"expression": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "describe",
"range": [
136,
144
],
"loc": {
"start": {
"line": 6,
"column": 0
},
"end": {
"line": 6,
"column": 8
}
}
},
"arguments": [
{
"type": "Literal",
"value": "Observable.prototype.share",
"raw": "'Observable.prototype.share'",
"range": [
145,
173
],
"loc": {
"start": {
"line": 6,
"column": 9
},
"end": {
"line": 6,
"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": [
193,
202
],
"loc": {
"start": {
"line": 7,
"column": 4
},
"end": {
"line": 7,
"column": 13
}
}
},
"arguments": [
{
"type": "Literal",
"value": "share",
"raw": "'share'",
"range": [
203,
210
],
"loc": {
"start": {
"line": 7,
"column": 14
},
"end": {
"line": 7,
"column": 21
}
}
}
],
"range": [
193,
211
],
"loc": {
"start": {
"line": 7,
"column": 4
},
"end": {
"line": 7,
"column": 22
}
}
},
"arguments": [
{
"type": "Literal",
"value": "should mirror a simple source Observable",
"raw": "'should mirror a simple source Observable'",
"range": [
212,
254
],
"loc": {
"start": {
"line": 7,
"column": 23
},
"end": {
"line": 7,
"column": 65
}
}
},
{
"type": "FunctionExpression",
"id": null,
"params": [],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "source",
"range": [
282,
288
],
"loc": {
"start": {
"line": 8,
"column": 12
},
"end": {
"line": 8,
"column": 18
}
}
},
"init": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "cold",
"range": [
291,
295
],
"loc": {
"start": {
"line": 8,
"column": 21
},
"end": {
"line": 8,
"column": 25
}
}
},
"arguments": [
{
"type": "Literal",
"value": "--1-2---3-4--5-|",
"raw": "'--1-2---3-4--5-|'",
"range": [
296,
314
],
"loc": {
"start": {
"line": 8,
"column": 26
},
"end": {
"line": 8,
"column": 44
}
}
}
],
"range": [
291,
315
],
"loc": {
"start": {
"line": 8,
"column": 21
},
"end": {
"line": 8,
"column": 45
}
}
},
"range": [
282,
315
],
"loc": {
"start": {
"line": 8,
"column": 12
},
"end": {
"line": 8,
"column": 45
}
}
}
],
"kind": "var",
"range": [
278,
316
],
"loc": {
"start": {
"line": 8,
"column": 8
},
"end": {
"line": 8,
"column": 46
}
}
},
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "sourceSubs",
"range": [
329,
339
],
"loc": {
"start": {
"line": 9,
"column": 12
},
"end": {
"line": 9,
"column": 22
}
}
},
"init": {
"type": "Literal",
"value": "^ !",
"raw": "'^ !'",
"range": [
342,
360
],
"loc": {
"start": {
"line": 9,
"column": 25
},
"end": {
"line": 9,
"column": 43
}
}
},
"range": [
329,
360
],
"loc": {
"start": {
"line": 9,
"column": 12
},
"end": {
"line": 9,
"column": 43
}
}
}
],
"kind": "var",
"range": [
325,
361
],
"loc": {
"start": {
"line": 9,
"column": 8
},
"end": {
"line": 9,
"column": 44
}
}
},
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "expected",
"range": [
374,
382
],
"loc": {
"start": {
"line": 10,
"column": 12
},
"end": {
"line": 10,
"column": 20
}
}
},
"init": {
"type": "Literal",
"value": "--1-2---3-4--5-|",
"raw": "'--1-2---3-4--5-|'",
"range": [
385,
403
],
"loc": {
"start": {
"line": 10,
"column": 23
},
"end": {
"line": 10,
"column": 41
}
}
},
"range": [
374,
403
],
"loc": {
"start": {
"line": 10,
"column": 12
},
"end": {
"line": 10,
"column": 41
}
}
}
],
"kind": "var",
"range": [
370,
404
],
"loc": {
"start": {
"line": 10,
"column": 8
},
"end": {
"line": 10,
"column": 42
}
}
},
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "shared",
"range": [
417,
423
],
"loc": {
"start": {
"line": 11,
"column": 12
},
"end": {
"line": 11,
"column": 18
}
}
},
"init": {
"type": "CallExpression",
"callee": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "Identifier",
"name": "source",
"range": [
426,
432
],
"loc": {
"start": {
"line": 11,
"column": 21
},
"end": {
"line": 11,
"column": 27
}
}
},
"property": {
"type": "Identifier",
"name": "share",
"range": [
433,
438
],
"loc": {
"start": {
"line": 11,
"column": 28
},
"end": {
"line": 11,
"column": 33
}
}
},
"range": [
426,
438
],
"loc": {
"start": {
"line": 11,
"column": 21
},
"end": {
"line": 11,
"column": 33
}
}
},
"arguments": [],
"range": [
426,
440
],
"loc": {
"start": {
"line": 11,
"column": 21
},
"end": {
"line": 11,
"column": 35
}
}
},
"range": [
417,
440
],
"loc": {
"start": {
"line": 11,
"column": 12
},
"end": {
"line": 11,
"column": 35
}
}
}
],
"kind": "var",
"range": [
413,
441
],
"loc": {
"start": {
"line": 11,
"column": 8
},
"end": {
"line": 11,
"column": 36
}
}
},
{
"type": "ExpressionStatement",
"expression": {
"type": "CallExpression",
"callee": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "expectObservable",
"range": [
450,
466
],
"loc": {
"start": {
"line": 12,
"column": 8
},
"end": {
"line": 12,
"column": 24
}
}
},
"arguments": [
{
"type": "Identifier",
"name": "shared",
"range": [
467,
473
],
"loc": {
"start": {
"line": 12,
"column": 25
},
"end": {
"line": 12,
"column": 31
}
}
}
],
"range": [
450,
474
],
"loc": {
"start": {
"line": 12,
"column": 8
},
"end": {
"line": 12,
"column": 32
}
}
},
"property": {
"type": "Identifier",
"name": "toBe",
"range": [
475,
479
],
"loc": {
"start": {
"line": 12,
"column": 33
},
"end": {
"line": 12,
"column": 37
}
}
},
"range": [
450,
479
],
"loc": {
"start": {
"line": 12,
"column": 8
},
"end": {
"line": 12,
"column": 37
}
}
},
"arguments": [
{
"type": "Identifier",
"name": "expected",
"range": [
480,
488
],
"loc": {
"start": {
"line": 12,
"column": 38
},
"end": {
"line": 12,
"column": 46
}
}
}
],
"range": [
450,
489
],
"loc": {
"start": {
"line": 12,
"column": 8
},
"end": {
"line": 12,
"column": 47
}
}
},
"range": [
450,
490
],
"loc": {
"start": {
"line": 12,
"column": 8
},
"end": {
"line": 12,
"column": 48
}
}
},
{
"type": "ExpressionStatement",
"expression": {
"type": "CallExpression",
"callee": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "expectSubscriptions",
"range": [
499,
518
],
"loc": {
"start": {
"line": 13,
"column": 8
},
"end": {
"line": 13,
"column": 27
}
}
},
"arguments": [
{
"type": "MemberExpression",
"computed": false,
"object": {
"type": "Identifier",
"name": "source",
"range": [
519,
525
],
"loc": {
"start": {
"line": 13,
"column": 28
},
"end": {
"line": 13,
"column": 34
}
}
},
"property": {
"type": "Identifier",
"name": "subscriptions",
"range": [
526,
539
],
"loc": {
"start": {
"line": 13,
"column": 35
},
"end": {
"line": 13,
"column": 48
}
}
},
"range": [
519,
539
],
"loc": {
"start": {
"line": 13,
"column": 28
},
"end": {
"line": 13,
"column": 48
}
}
}
],
"range": [
499,
540
],
"loc": {
"start": {
"line": 13,
"column": 8
},
"end": {
"line": 13,
"column": 49
}
}
},
"property": {
"type": "Identifier",
"name": "toBe",
"range": [
541,
545
],
"loc": {
"start": {
"line": 13,
"column": 50
},
"end": {
"line": 13,
"column": 54
}
}
},
"range": [
499,
545
],
"loc": {
"start": {
"line": 13,
"column": 8
},
"end": {
"line": 13,
"column": 54
}
}
},
"arguments": [
{
"type": "Identifier",
"name": "sourceSubs",
"range": [
546,
556
],
"loc": {
"start": {
"line": 13,
"column": 55
},
"end": {
"line": 13,
"column": 65
}
}
}
],
"range": [
499,
557
],
"loc": {
"start": {
"line": 13,
"column": 8
},
"end": {
"line": 13,
"column": 66
}
}
},
"range": [
499,
558
],
"loc": {
"start": {
"line": 13,
"column": 8
},
"end": {
"line": 13,
"column": 67
}
}
}
],
"range": [
268,
564
],
"loc": {
"start": {
"line": 7,
"column": 79
},
"end": {
"line": 14,
"column": 5
}
}
},
"generator": false,
"expression": false,
"range": [
256,
564
],
"loc": {
"start": {
"line": 7,
"column": 67
},
"end": {
"line": 14,
"column": 5
}
}
}
],
"range": [
193,
565
],
"loc": {
"start": {
"line": 7,
"column": 4
},
"end": {
"line": 14,
"column": 6
}
}
},
"range": [
193,
566
],
"loc": {
"start": {
"line": 7,
"column": 4
},
"end": {
"line": 14,
"column": 7
}
}
},
{
"type": "ExpressionStatement",
"expression": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "it",
"range": [
571,
573
],
"loc": {
"start": {
"line": 15,
"column": 4
},
"end": {
"line": 15,
"column": 6
}
}
},
"arguments": [
{
"type": "Literal",
"value": "should share a single subscription",
"raw": "'should share a single subscription'",
"range": [
574,
610
],
"loc": {
"start": {
"line": 15,
"column": 7
},
"end": {
"line": 15,
"column": 43
}
}
},
{
"type": "FunctionExpression",
"id": null,
"params": [],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "subscriptionCount",
"range": [
638,
655
],
"loc": {
"start": {
"line": 16,
"column": 12
},
"end": {
"line": 16,
"column": 29
}
}
},
"init": {