hunk.code_window:           let results;
             this._isScalar = true;
             if (selector) {
               results = tryCatch(selector).apply(ctx, innerArgs);
               if (results === errorObject) {
                 return subscription.add(scheduler.schedule(dispatchError, 0, { err: results.e, subscriber }));
               }
  
hunk.labels: keep keep keep keep keep replace keep keep keep
hunk.after_edit:             results = tryCatch(selector).apply(this, innerArgs);
  
hunk.file_path: src/observable/bindCallback.ts
hunk.type: replace
file: import {Operator} from '../Operator';
  import {Subscriber} from '../Subscriber';
  import {tryCatch} from '../util/tryCatch';
  import {errorObject} from '../util/errorObject';
  
  export class ReduceOperator<T, R> implements Operator<T, R> {
  
    constructor(private project: (acc: R, x: T) => R, private seed?: R) {
    }
  
    call(subscriber: Subscriber<T>): Subscriber<T> {
      return new ReduceSubscriber(subscriber, this.project, this.seed);
    }
  }
  
  export class ReduceSubscriber<T, R> extends Subscriber<T> {
  
    acc: R;
    hasSeed: boolean;
    hasValue: boolean = false;
    project: (acc: R, x: T) => R;
  
    constructor(destination: Subscriber<T>, project: (acc: R, x: T) => R, seed?: R) {
      super(destination);
      this.acc = seed;
      this.project = project;
      this.hasSeed = typeof seed !== 'undefined';
    }
  
    _next(x) {
      if (this.hasValue || (this.hasValue = this.hasSeed)) {
        const result = tryCatch(this.project).call(this, this.acc, x);
        if (result === errorObject) {
          this.destination.error(errorObject.e);
        } else {
          this.acc = result;
        }
      } else {
        this.acc = x;
        this.hasValue = true;
      }
    }
  
    _complete() {
      if (this.hasValue || this.hasSeed) {
        this.destination.next(this.acc);
      }
      this.destination.complete();
    }
  }
  