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

Commit b7f17e1

Browse files
Fixing through when
1 parent cecdaf2 commit b7f17e1

File tree

106 files changed

+13100
-8707
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+13100
-8707
lines changed

dist/rx.aggregates.js

+2-7
Original file line numberDiff line numberDiff line change
@@ -759,13 +759,8 @@
759759
return new AnonymousObservable(function (o) {
760760
var i = 0;
761761
return source.subscribe(function (x) {
762-
var shouldRun;
763-
try {
764-
shouldRun = callback(x, i, source);
765-
} catch (e) {
766-
o.onError(e);
767-
return;
768-
}
762+
var shouldRun = tryCatch(callback)(x, i, source);
763+
if (shouldRun === errorObj) { return o.onError(shouldRun.e); }
769764
if (shouldRun) {
770765
o.onNext(yieldIndex ? i : x);
771766
o.onCompleted();

dist/rx.aggregates.map

+1-1
Large diffs are not rendered by default.

dist/rx.aggregates.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/rx.all.compat.js

+2-7
Original file line numberDiff line numberDiff line change
@@ -6226,13 +6226,8 @@ Rx.Observable.prototype.flatMapLatest = function(selector, resultSelector, thisA
62266226
return new AnonymousObservable(function (o) {
62276227
var i = 0;
62286228
return source.subscribe(function (x) {
6229-
var shouldRun;
6230-
try {
6231-
shouldRun = callback(x, i, source);
6232-
} catch (e) {
6233-
o.onError(e);
6234-
return;
6235-
}
6229+
var shouldRun = tryCatch(callback)(x, i, source);
6230+
if (shouldRun === errorObj) { return o.onError(shouldRun.e); }
62366231
if (shouldRun) {
62376232
o.onNext(yieldIndex ? i : x);
62386233
o.onCompleted();

dist/rx.all.compat.map

+1-1
Large diffs are not rendered by default.

dist/rx.all.compat.min.js

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/rx.all.js

+2-7
Original file line numberDiff line numberDiff line change
@@ -6088,13 +6088,8 @@ Rx.Observable.prototype.flatMapLatest = function(selector, resultSelector, thisA
60886088
return new AnonymousObservable(function (o) {
60896089
var i = 0;
60906090
return source.subscribe(function (x) {
6091-
var shouldRun;
6092-
try {
6093-
shouldRun = callback(x, i, source);
6094-
} catch (e) {
6095-
o.onError(e);
6096-
return;
6097-
}
6091+
var shouldRun = tryCatch(callback)(x, i, source);
6092+
if (shouldRun === errorObj) { return o.onError(shouldRun.e); }
60986093
if (shouldRun) {
60996094
o.onNext(yieldIndex ? i : x);
61006095
o.onCompleted();

dist/rx.all.map

+1-1
Large diffs are not rendered by default.

dist/rx.all.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

modules/rx-lite-aggregates-compat/rx.lite.aggregates.compat.js

+2-7
Original file line numberDiff line numberDiff line change
@@ -759,13 +759,8 @@
759759
return new AnonymousObservable(function (o) {
760760
var i = 0;
761761
return source.subscribe(function (x) {
762-
var shouldRun;
763-
try {
764-
shouldRun = callback(x, i, source);
765-
} catch (e) {
766-
o.onError(e);
767-
return;
768-
}
762+
var shouldRun = tryCatch(callback)(x, i, source);
763+
if (shouldRun === errorObj) { return o.onError(shouldRun.e); }
769764
if (shouldRun) {
770765
o.onNext(yieldIndex ? i : x);
771766
o.onCompleted();

modules/rx-lite-aggregates-compat/rx.lite.aggregates.compat.map

+1-1
Large diffs are not rendered by default.

modules/rx-lite-aggregates-compat/rx.lite.aggregates.compat.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

modules/rx-lite-aggregates/rx.lite.aggregates.js

+2-7
Original file line numberDiff line numberDiff line change
@@ -759,13 +759,8 @@
759759
return new AnonymousObservable(function (o) {
760760
var i = 0;
761761
return source.subscribe(function (x) {
762-
var shouldRun;
763-
try {
764-
shouldRun = callback(x, i, source);
765-
} catch (e) {
766-
o.onError(e);
767-
return;
768-
}
762+
var shouldRun = tryCatch(callback)(x, i, source);
763+
if (shouldRun === errorObj) { return o.onError(shouldRun.e); }
769764
if (shouldRun) {
770765
o.onNext(yieldIndex ? i : x);
771766
o.onCompleted();

modules/rx-lite-aggregates/rx.lite.aggregates.map

+1-1
Large diffs are not rendered by default.

modules/rx-lite-aggregates/rx.lite.aggregates.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/core/linq/observable/_findvalue.js

+2-7
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,8 @@
33
return new AnonymousObservable(function (o) {
44
var i = 0;
55
return source.subscribe(function (x) {
6-
var shouldRun;
7-
try {
8-
shouldRun = callback(x, i, source);
9-
} catch (e) {
10-
o.onError(e);
11-
return;
12-
}
6+
var shouldRun = tryCatch(callback)(x, i, source);
7+
if (shouldRun === errorObj) { return o.onError(shouldRun.e); }
138
if (shouldRun) {
149
o.onNext(yieldIndex ? i : x);
1510
o.onCompleted();

tests/observable/ambproto.js renamed to tests/observable/amb.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
(function () {
2+
'use strict';
23
/* jshint undef: true, unused: true */
34
/* globals QUnit, test, Rx, ok */
45

5-
QUnit.module('AmbProto');
6+
QUnit.module('amb');
67

78
var Observable = Rx.Observable,
89
TestScheduler = Rx.TestScheduler,

tests/observable/bufferwithcount.js

+10-10
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/* jshint undef: true, unused: true */
33
/* globals QUnit, test, Rx */
44

5-
QUnit.module('BufferWithCount');
5+
QUnit.module('bufferWithCount');
66

77
var TestScheduler = Rx.TestScheduler,
88
onNext = Rx.ReactiveTest.onNext,
@@ -11,7 +11,7 @@
1111
subscribe = Rx.ReactiveTest.subscribe;
1212

1313

14-
test('Buffer Count PartialWindow', function () {
14+
test('bufferWithCount partial window', function () {
1515
var scheduler = new TestScheduler();
1616

1717
var xs = scheduler.createHotObservable(
@@ -32,7 +32,7 @@
3232
);
3333
});
3434

35-
test('Buffer Count FullWindows', function () {
35+
test('bufferWithCount full windows', function () {
3636
var scheduler = new TestScheduler();
3737

3838
var xs = scheduler.createHotObservable(
@@ -54,7 +54,7 @@
5454
);
5555
});
5656

57-
test('Buffer Count FullAndPartialWindows', function () {
57+
test('bufferWithCount full and partial windows', function () {
5858
var scheduler = new TestScheduler();
5959

6060
var xs = scheduler.createHotObservable(
@@ -71,12 +71,12 @@
7171

7272
results.messages.assertEqual(
7373
onNext(230, [2,3,4]),
74-
onNext(240, [5]),
74+
onNext(250, [5]),
7575
onCompleted(250)
7676
);
7777
});
7878

79-
test('Buffer Count Error', function () {
79+
test('bufferWithCount Error', function () {
8080
var error = new Error();
8181

8282
var scheduler = new TestScheduler();
@@ -98,7 +98,7 @@
9898
);
9999
});
100100

101-
test('Buffer Count Skip Less', function () {
101+
test('bufferWithCount skip less', function () {
102102
var scheduler = new TestScheduler();
103103

104104
var xs = scheduler.createHotObservable(
@@ -122,7 +122,7 @@
122122
);
123123
});
124124

125-
test('Buffer Count Skip More', function () {
125+
test('bufferWithCount skip more', function () {
126126
var scheduler = new TestScheduler();
127127

128128
var xs = scheduler.createHotObservable(
@@ -144,7 +144,7 @@
144144
);
145145
});
146146

147-
test('BufferWithCount Basic', function () {
147+
test('bufferWithCount basic', function () {
148148
var scheduler = new TestScheduler();
149149

150150
var xs = scheduler.createHotObservable(
@@ -173,7 +173,7 @@
173173
xs.subscriptions.assertEqual(subscribe(200, 600));
174174
});
175175

176-
test('BufferWithCount Disposed', function () {
176+
test('BufferWithCount disposed', function () {
177177
var scheduler = new TestScheduler();
178178

179179
var xs = scheduler.createHotObservable(

tests/observable/bufferwithtimeorcount.js

+28-17
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
onCompleted = Rx.ReactiveTest.onCompleted,
1111
subscribe = Rx.ReactiveTest.subscribe;
1212

13-
test('bufferWithTimeOrCount Basic', function () {
13+
test('bufferWithTimeOrCount basic', function () {
1414
var scheduler = new TestScheduler();
1515

1616
var xs = scheduler.createHotObservable(
@@ -23,9 +23,10 @@
2323
onNext(370, 7),
2424
onNext(420, 8),
2525
onNext(470, 9),
26-
onCompleted(600));
26+
onCompleted(600)
27+
);
2728

28-
var results = scheduler.startWithCreate(function () {
29+
var results = scheduler.startScheduler(function () {
2930
return xs.bufferWithTimeOrCount(70, 3, scheduler);
3031
});
3132

@@ -37,13 +38,15 @@
3738
onNext(510, [9]),
3839
onNext(580, []),
3940
onNext(600, []),
40-
onCompleted(600));
41+
onCompleted(600)
42+
);
4143

4244
xs.subscriptions.assertEqual(
43-
subscribe(200, 600));
45+
subscribe(200, 600)
46+
);
4447
});
4548

46-
test('bufferWithTimeOrCount Error', function () {
49+
test('bufferWithTimeOrCount error', function () {
4750
var error = new Error();
4851

4952
var scheduler = new TestScheduler();
@@ -58,9 +61,10 @@
5861
onNext(370, 7),
5962
onNext(420, 8),
6063
onNext(470, 9),
61-
onError(600, error));
64+
onError(600, error)
65+
);
6266

63-
var results = scheduler.startWithCreate(function () {
67+
var results = scheduler.startScheduler(function () {
6468
return xs.bufferWithTimeOrCount(70, 3, scheduler);
6569
});
6670

@@ -71,13 +75,15 @@
7175
onNext(440, [8]),
7276
onNext(510, [9]),
7377
onNext(580, []),
74-
onError(600, error));
78+
onError(600, error)
79+
);
7580

7681
xs.subscriptions.assertEqual(
77-
subscribe(200, 600));
82+
subscribe(200, 600)
83+
);
7884
});
7985

80-
test('bufferWithTimeOrCount Disposed', function () {
86+
test('bufferWithTimeOrCount disposed', function () {
8187
var scheduler = new TestScheduler();
8288

8389
var xs = scheduler.createHotObservable(
@@ -90,19 +96,22 @@
9096
onNext(370, 7),
9197
onNext(420, 8),
9298
onNext(470, 9),
93-
onCompleted(600));
99+
onCompleted(600)
100+
);
94101

95102
var results = scheduler.startScheduler(function () {
96103
return xs.bufferWithTimeOrCount(70, 3, scheduler);
97-
}, 370);
104+
}, { disposed: 370 });
98105

99106
results.messages.assertEqual(
100107
onNext(240, [1,2,3]),
101108
onNext(310, [4]),
102-
onNext(370, [5,6,7]));
109+
onNext(370, [5,6,7])
110+
);
103111

104112
xs.subscriptions.assertEqual(
105-
subscribe(200, 370));
113+
subscribe(200, 370)
114+
);
106115
});
107116

108117
test('multiple bufferWithTimeOrCounts', function(){
@@ -129,13 +138,15 @@
129138
onNext(570, []),
130139
onNext(670, []),
131140
onNext(700, []),
132-
onCompleted(700));
141+
onCompleted(700)
142+
);
133143

134144
results2.messages.assertEqual(
135145
onNext(520, []),
136146
onNext(670, []),
137147
onNext(700, []),
138-
onCompleted(700));
148+
onCompleted(700)
149+
);
139150
});
140151

141152
}());
File renamed without changes.

0 commit comments

Comments
 (0)