Skip to content
This repository was archived by the owner on Apr 20, 2018. It is now read-only.

Commit 38224e7

Browse files
Fixing issue #720
1 parent f86d7c1 commit 38224e7

36 files changed

Lines changed: 395 additions & 434 deletions

dist/rx.all.compat.js

Lines changed: 47 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -3033,7 +3033,7 @@
30333033
inherits(RangeObservable, __super__);
30343034
function RangeObservable(start, count, scheduler) {
30353035
this.start = start;
3036-
this.count = count;
3036+
this.rangeCount = count;
30373037
this.scheduler = scheduler;
30383038
__super__.call(this);
30393039
}
@@ -3053,7 +3053,7 @@
30533053
}
30543054

30553055
RangeSink.prototype.run = function () {
3056-
var start = this.parent.start, count = this.parent.count, observer = this.observer;
3056+
var start = this.parent.start, count = this.parent.rangeCount, observer = this.observer;
30573057
function loopRecursive(i, recurse) {
30583058
if (i < count) {
30593059
observer.onNext(start + i);
@@ -5314,12 +5314,12 @@
53145314
inherits(SkipObservable, __super__);
53155315
function SkipObservable(source, count) {
53165316
this.source = source;
5317-
this.count = count;
5317+
this.skipCount = count;
53185318
__super__.call(this);
53195319
}
53205320

53215321
SkipObservable.prototype.subscribeCore = function (o) {
5322-
return this.source.subscribe(new InnerObserver(o, this.count));
5322+
return this.source.subscribe(new InnerObserver(o, this.skipCount));
53235323
};
53245324

53255325
function InnerObserver(o, c) {
@@ -5398,12 +5398,12 @@
53985398

53995399
function TakeObservable(source, count) {
54005400
this.source = source;
5401-
this.count = count;
5401+
this.takeCount = count;
54025402
__super__.call(this);
54035403
}
54045404

54055405
TakeObservable.prototype.subscribeCore = function (o) {
5406-
return this.source.subscribe(new InnerObserver(o, this.count));
5406+
return this.source.subscribe(new InnerObserver(o, this.takeCount));
54075407
};
54085408

54095409
function InnerObserver(o, c) {
@@ -5412,43 +5412,42 @@
54125412
this.r = c;
54135413
this.isStopped = false;
54145414
}
5415-
InnerObserver.prototype.onNext = function (x) {
5416-
if (this.isStopped) { return; }
5417-
if (this.r-- > 0) {
5418-
this.o.onNext(x);
5419-
this.r === 0 && this.o.onCompleted();
5420-
}
5421-
};
5422-
InnerObserver.prototype.onError = function (err) {
5423-
if (!this.isStopped) {
5424-
this.isStopped = true;
5425-
this.o.onError(err);
5426-
}
5427-
};
5428-
InnerObserver.prototype.onCompleted = function () {
5429-
if (!this.isStopped) {
5430-
this.isStopped = true;
5431-
this.o.onCompleted();
5432-
}
5433-
};
5434-
InnerObserver.prototype.dispose = function () { this.isStopped = true; };
5435-
InnerObserver.prototype.fail = function (e) {
5436-
if (!this.isStopped) {
5437-
this.isStopped = true;
5438-
this.o.onError(e);
5439-
return true;
5415+
InnerObserver.prototype = {
5416+
onNext: function (x) {
5417+
if (this.isStopped) { return; }
5418+
if (this.r-- > 0) {
5419+
this.o.onNext(x);
5420+
this.r <= 0 && this.o.onCompleted();
5421+
}
5422+
},
5423+
onError: function (err) {
5424+
if (!this.isStopped) {
5425+
this.isStopped = true;
5426+
this.o.onError(err);
5427+
}
5428+
},
5429+
onCompleted: function () {
5430+
if (!this.isStopped) {
5431+
this.isStopped = true;
5432+
this.o.onCompleted();
5433+
}
5434+
},
5435+
dispose: function () { this.isStopped = true; },
5436+
fail: function (e) {
5437+
if (!this.isStopped) {
5438+
this.isStopped = true;
5439+
this.o.onError(e);
5440+
return true;
5441+
}
5442+
return false;
54405443
}
5441-
return false;
54425444
};
54435445

54445446
return TakeObservable;
54455447
}(ObservableBase));
54465448

54475449
/**
54485450
* Returns a specified number of contiguous elements from the start of an observable sequence, using the specified scheduler for the edge case of take(0).
5449-
*
5450-
* var res = source.take(5);
5451-
* var res = source.take(0, Rx.Scheduler.timeout);
54525451
* @param {Number} count The number of elements to return.
54535452
* @param {Scheduler} [scheduler] Scheduler used to produce an OnCompleted message in case <paramref name="count count</paramref> is set to 0.
54545453
* @returns {Observable} An observable sequence that contains the specified number of elements from the start of the input sequence.
@@ -7170,7 +7169,7 @@
71707169
* source.request(3); // Reads 3 values
71717170
* @param {bool} enableQueue truthy value to determine if values should be queued pending the next request
71727171
* @param {Scheduler} scheduler determines how the requests will be scheduled
7173-
* @returns {Observable} The observable sequence which is paused based upon the pauser.
7172+
* @returns {Observable} The observable sequence which only propagates values on request.
71747173
*/
71757174
observableProto.controlled = function (enableQueue, scheduler) {
71767175

@@ -9680,12 +9679,9 @@
96809679
isScheduler(scheduler) || (scheduler = timeoutScheduler);
96819680
return new AnonymousObservable(function (observer) {
96829681
var first = true,
9683-
hasResult = false,
9684-
result,
9685-
state = initialState,
9686-
time;
9687-
return scheduler.scheduleRecursiveWithAbsolute(scheduler.now(), function (self) {
9688-
hasResult && observer.onNext(result);
9682+
hasResult = false;
9683+
return scheduler.scheduleRecursiveWithAbsoluteAndState(initialState, scheduler.now(), function (state, self) {
9684+
hasResult && observer.onNext(state);
96899685

96909686
try {
96919687
if (first) {
@@ -9695,15 +9691,15 @@
96959691
}
96969692
hasResult = condition(state);
96979693
if (hasResult) {
9698-
result = resultSelector(state);
9699-
time = timeSelector(state);
9694+
var result = resultSelector(state);
9695+
var time = timeSelector(state);
97009696
}
97019697
} catch (e) {
97029698
observer.onError(e);
97039699
return;
97049700
}
97059701
if (hasResult) {
9706-
self(time);
9702+
self(result, time);
97079703
} else {
97089704
observer.onCompleted();
97099705
}
@@ -9734,12 +9730,9 @@
97349730
isScheduler(scheduler) || (scheduler = timeoutScheduler);
97359731
return new AnonymousObservable(function (observer) {
97369732
var first = true,
9737-
hasResult = false,
9738-
result,
9739-
state = initialState,
9740-
time;
9741-
return scheduler.scheduleRecursiveWithRelative(0, function (self) {
9742-
hasResult && observer.onNext(result);
9733+
hasResult = false;
9734+
return scheduler.scheduleRecursiveWithRelativeAndState(initialState, 0, function (state, self) {
9735+
hasResult && observer.onNext(state);
97439736

97449737
try {
97459738
if (first) {
@@ -9749,15 +9742,15 @@
97499742
}
97509743
hasResult = condition(state);
97519744
if (hasResult) {
9752-
result = resultSelector(state);
9753-
time = timeSelector(state);
9745+
var result = resultSelector(state);
9746+
var time = timeSelector(state);
97549747
}
97559748
} catch (e) {
97569749
observer.onError(e);
97579750
return;
97589751
}
97599752
if (hasResult) {
9760-
self(time);
9753+
self(result, time);
97619754
} else {
97629755
observer.onCompleted();
97639756
}

dist/rx.all.compat.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/rx.all.compat.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/rx.all.js

Lines changed: 47 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -2888,7 +2888,7 @@
28882888
inherits(RangeObservable, __super__);
28892889
function RangeObservable(start, count, scheduler) {
28902890
this.start = start;
2891-
this.count = count;
2891+
this.rangeCount = count;
28922892
this.scheduler = scheduler;
28932893
__super__.call(this);
28942894
}
@@ -2908,7 +2908,7 @@
29082908
}
29092909

29102910
RangeSink.prototype.run = function () {
2911-
var start = this.parent.start, count = this.parent.count, observer = this.observer;
2911+
var start = this.parent.start, count = this.parent.rangeCount, observer = this.observer;
29122912
function loopRecursive(i, recurse) {
29132913
if (i < count) {
29142914
observer.onNext(start + i);
@@ -5169,12 +5169,12 @@
51695169
inherits(SkipObservable, __super__);
51705170
function SkipObservable(source, count) {
51715171
this.source = source;
5172-
this.count = count;
5172+
this.skipCount = count;
51735173
__super__.call(this);
51745174
}
51755175

51765176
SkipObservable.prototype.subscribeCore = function (o) {
5177-
return this.source.subscribe(new InnerObserver(o, this.count));
5177+
return this.source.subscribe(new InnerObserver(o, this.skipCount));
51785178
};
51795179

51805180
function InnerObserver(o, c) {
@@ -5253,12 +5253,12 @@
52535253

52545254
function TakeObservable(source, count) {
52555255
this.source = source;
5256-
this.count = count;
5256+
this.takeCount = count;
52575257
__super__.call(this);
52585258
}
52595259

52605260
TakeObservable.prototype.subscribeCore = function (o) {
5261-
return this.source.subscribe(new InnerObserver(o, this.count));
5261+
return this.source.subscribe(new InnerObserver(o, this.takeCount));
52625262
};
52635263

52645264
function InnerObserver(o, c) {
@@ -5267,43 +5267,42 @@
52675267
this.r = c;
52685268
this.isStopped = false;
52695269
}
5270-
InnerObserver.prototype.onNext = function (x) {
5271-
if (this.isStopped) { return; }
5272-
if (this.r-- > 0) {
5273-
this.o.onNext(x);
5274-
this.r === 0 && this.o.onCompleted();
5275-
}
5276-
};
5277-
InnerObserver.prototype.onError = function (err) {
5278-
if (!this.isStopped) {
5279-
this.isStopped = true;
5280-
this.o.onError(err);
5281-
}
5282-
};
5283-
InnerObserver.prototype.onCompleted = function () {
5284-
if (!this.isStopped) {
5285-
this.isStopped = true;
5286-
this.o.onCompleted();
5287-
}
5288-
};
5289-
InnerObserver.prototype.dispose = function () { this.isStopped = true; };
5290-
InnerObserver.prototype.fail = function (e) {
5291-
if (!this.isStopped) {
5292-
this.isStopped = true;
5293-
this.o.onError(e);
5294-
return true;
5270+
InnerObserver.prototype = {
5271+
onNext: function (x) {
5272+
if (this.isStopped) { return; }
5273+
if (this.r-- > 0) {
5274+
this.o.onNext(x);
5275+
this.r <= 0 && this.o.onCompleted();
5276+
}
5277+
},
5278+
onError: function (err) {
5279+
if (!this.isStopped) {
5280+
this.isStopped = true;
5281+
this.o.onError(err);
5282+
}
5283+
},
5284+
onCompleted: function () {
5285+
if (!this.isStopped) {
5286+
this.isStopped = true;
5287+
this.o.onCompleted();
5288+
}
5289+
},
5290+
dispose: function () { this.isStopped = true; },
5291+
fail: function (e) {
5292+
if (!this.isStopped) {
5293+
this.isStopped = true;
5294+
this.o.onError(e);
5295+
return true;
5296+
}
5297+
return false;
52955298
}
5296-
return false;
52975299
};
52985300

52995301
return TakeObservable;
53005302
}(ObservableBase));
53015303

53025304
/**
53035305
* Returns a specified number of contiguous elements from the start of an observable sequence, using the specified scheduler for the edge case of take(0).
5304-
*
5305-
* var res = source.take(5);
5306-
* var res = source.take(0, Rx.Scheduler.timeout);
53075306
* @param {Number} count The number of elements to return.
53085307
* @param {Scheduler} [scheduler] Scheduler used to produce an OnCompleted message in case <paramref name="count count</paramref> is set to 0.
53095308
* @returns {Observable} An observable sequence that contains the specified number of elements from the start of the input sequence.
@@ -6943,7 +6942,7 @@
69436942
* source.request(3); // Reads 3 values
69446943
* @param {bool} enableQueue truthy value to determine if values should be queued pending the next request
69456944
* @param {Scheduler} scheduler determines how the requests will be scheduled
6946-
* @returns {Observable} The observable sequence which is paused based upon the pauser.
6945+
* @returns {Observable} The observable sequence which only propagates values on request.
69476946
*/
69486947
observableProto.controlled = function (enableQueue, scheduler) {
69496948

@@ -9453,12 +9452,9 @@
94539452
isScheduler(scheduler) || (scheduler = timeoutScheduler);
94549453
return new AnonymousObservable(function (observer) {
94559454
var first = true,
9456-
hasResult = false,
9457-
result,
9458-
state = initialState,
9459-
time;
9460-
return scheduler.scheduleRecursiveWithAbsolute(scheduler.now(), function (self) {
9461-
hasResult && observer.onNext(result);
9455+
hasResult = false;
9456+
return scheduler.scheduleRecursiveWithAbsoluteAndState(initialState, scheduler.now(), function (state, self) {
9457+
hasResult && observer.onNext(state);
94629458

94639459
try {
94649460
if (first) {
@@ -9468,15 +9464,15 @@
94689464
}
94699465
hasResult = condition(state);
94709466
if (hasResult) {
9471-
result = resultSelector(state);
9472-
time = timeSelector(state);
9467+
var result = resultSelector(state);
9468+
var time = timeSelector(state);
94739469
}
94749470
} catch (e) {
94759471
observer.onError(e);
94769472
return;
94779473
}
94789474
if (hasResult) {
9479-
self(time);
9475+
self(result, time);
94809476
} else {
94819477
observer.onCompleted();
94829478
}
@@ -9507,12 +9503,9 @@
95079503
isScheduler(scheduler) || (scheduler = timeoutScheduler);
95089504
return new AnonymousObservable(function (observer) {
95099505
var first = true,
9510-
hasResult = false,
9511-
result,
9512-
state = initialState,
9513-
time;
9514-
return scheduler.scheduleRecursiveWithRelative(0, function (self) {
9515-
hasResult && observer.onNext(result);
9506+
hasResult = false;
9507+
return scheduler.scheduleRecursiveWithRelativeAndState(initialState, 0, function (state, self) {
9508+
hasResult && observer.onNext(state);
95169509

95179510
try {
95189511
if (first) {
@@ -9522,15 +9515,15 @@
95229515
}
95239516
hasResult = condition(state);
95249517
if (hasResult) {
9525-
result = resultSelector(state);
9526-
time = timeSelector(state);
9518+
var result = resultSelector(state);
9519+
var time = timeSelector(state);
95279520
}
95289521
} catch (e) {
95299522
observer.onError(e);
95309523
return;
95319524
}
95329525
if (hasResult) {
9533-
self(time);
9526+
self(result, time);
95349527
} else {
95359528
observer.onCompleted();
95369529
}

dist/rx.all.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/rx.all.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)