@@ -4,8 +4,6 @@ import {isArray} from '../util/isArray';
4
4
import { Operator } from '../Operator' ;
5
5
import { Observer } from '../Observer' ;
6
6
import { Subscriber } from '../Subscriber' ;
7
- import { tryCatch } from '../util/tryCatch' ;
8
- import { errorObject } from '../util/errorObject' ;
9
7
import { OuterSubscriber } from '../OuterSubscriber' ;
10
8
import { subscribeToResult } from '../util/subscribeToResult' ;
11
9
import { SymbolShim } from '../util/SymbolShim' ;
@@ -117,14 +115,8 @@ export class ZipSubscriber<T, R> extends Subscriber<T> {
117
115
args . push ( result . value ) ;
118
116
}
119
117
120
- const project = this . project ;
121
- if ( project ) {
122
- let result = tryCatch ( project ) . apply ( this , args ) ;
123
- if ( result === errorObject ) {
124
- destination . error ( errorObject . e ) ;
125
- } else {
126
- destination . next ( result ) ;
127
- }
118
+ if ( this . project ) {
119
+ this . _tryProject ( args ) ;
128
120
} else {
129
121
destination . next ( args ) ;
130
122
}
@@ -133,6 +125,17 @@ export class ZipSubscriber<T, R> extends Subscriber<T> {
133
125
destination . complete ( ) ;
134
126
}
135
127
}
128
+
129
+ protected _tryProject ( args : any [ ] ) {
130
+ let result : any ;
131
+ try {
132
+ result = this . project . apply ( this , args ) ;
133
+ } catch ( err ) {
134
+ this . destination . error ( err ) ;
135
+ return ;
136
+ }
137
+ this . destination . next ( result ) ;
138
+ }
136
139
}
137
140
138
141
interface LookAheadIterator < T > extends Iterator < T > {
0 commit comments