File tree Expand file tree Collapse file tree 1 file changed +11
-8
lines changed
Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change 11import { Operator } from '../Operator' ;
22import { Subscriber } from '../Subscriber' ;
3- import { tryCatch } from '../util/tryCatch' ;
4- import { errorObject } from '../util/errorObject' ;
53import { Observable } from '../Observable' ;
64
75/**
@@ -35,12 +33,17 @@ class FilterSubscriber<T> extends Subscriber<T> {
3533 this . select = select ;
3634 }
3735
38- protected _next ( x : T ) {
39- const result = tryCatch ( this . select ) . call ( this . thisArg || this , x , this . count ++ ) ;
40- if ( result === errorObject ) {
41- this . destination . error ( errorObject . e ) ;
42- } else if ( Boolean ( result ) ) {
43- this . destination . next ( x ) ;
36+ // the try catch block below is left specifically for
37+ // optimization and perf reasons. a tryCatcher is not necessary here.
38+ next ( value : T ) {
39+ let result : any ;
40+ try {
41+ result = this . select . call ( this . thisArg , value , this . count ++ ) ;
42+ } catch ( err ) {
43+ this . destination . error ( err ) ;
44+ }
45+ if ( result ) {
46+ this . destination . next ( value ) ;
4447 }
4548 }
4649}
You can’t perform that action at this time.
0 commit comments