hunk.code_window: var Map = require('../../dist/cjs/util/Map').Map;
   var Rx = require('../../dist/cjs/Rx');
   var polyfillSymbol = SymbolShim.polyfillSymbol;
   var ensureIterator = SymbolShim.ensureIterator;
   describe('SymbolShim', function () {
     it('should setup symbol if root does not have it', function () {
       var root = {};
       var result = polyfillSymbol(root);
       expect(root.Symbol).toBeDefined();
  
hunk.labels: keep keep keep keep keep replace keep keep keep keep keep
hunk.after_edit: describe('SymbolShim.polyfillSymbol', function () {
     it('should polyfill Symbol to be a function that returns a primitive that is unique', function () {
       var Symbol = polyfillSymbol({ });
       expect(typeof Symbol).toBe('function');
       var x = Symbol('test');
       var y = Symbol('test');
       expect(x !== y).toBe(true); // should be obvious, but this is the important part.
       expect(x).toBe('@@Symbol(test):0');
       expect(y).toBe('@@Symbol(test):1');
     });
  
hunk.file_path: spec/util/SymbolShim-spec.js
hunk.type: replace
file: import {Operator} from '../Operator';
  import {Subscriber} from '../Subscriber';
  import {Observable} from '../Observable';
  import {Subject} from '../Subject';
  
  export function windowCount<T>(windowSize: number,
                                 startWindowEvery: number = 0): Observable<Observable<T>> {
    return this.lift(new WindowCountOperator(windowSize, startWindowEvery));
  }
  
  class WindowCountOperator<T, R> implements Operator<T, R> {
  
    constructor(private windowSize: number,
                private startWindowEvery: number) {
    }
  
    call(subscriber: Subscriber<Observable<T>>): Subscriber<T> {
      return new WindowCountSubscriber(subscriber, this.windowSize, this.startWindowEvery);
    }
  }
  
  class WindowCountSubscriber<T> extends Subscriber<T> {
    private windows: Subject<T>[] = [ new Subject<T>() ];
    private count: number = 0;
  
    constructor(destination: Subscriber<Observable<T>>,
                private windowSize: number,
                private startWindowEvery: number) {
      super(destination);
      destination.next(this.windows[0]);
    }
  
    _next(value: T) {
      const startWindowEvery = (this.startWindowEvery > 0) ? this.startWindowEvery : this.windowSize;
      const windowSize = this.windowSize;
      const windows = this.windows;
      const len = windows.length;
  
      for (let i = 0; i < len; i++) {
        windows[i].next(value);
      }
      const c = this.count - windowSize + 1;
      if (c >= 0 && c % startWindowEvery === 0) {
        windows.shift().complete();
      }
      if (++this.count % startWindowEvery === 0) {
        let window = new Subject<T>();
        windows.push(window);
        this.destination.next(window);
      }
    }
  
    _error(err: any) {
      const windows = this.windows;
      while (windows.length > 0) {
        windows.shift().error(err);
      }
      this.destination.error(err);
    }
  
    _complete() {
      const windows = this.windows;
      while (windows.length > 0) {
        windows.shift().complete();
      }
      this.destination.complete();
    }
  }
  