hunk.code_window:   if (!Symbol.for) {
       Symbol.for = symbolForPolyfill;
     }
   }
   export function ensureSymbol(root) {
     if (!root.Symbol) {
  
hunk.labels: keep keep keep keep add keep keep
hunk.after_edit: let id = 0;
  
hunk.file_path: src/util/SymbolShim.ts
hunk.type: add
file: import {Subject} from '../Subject';
  import {Subscriber} from '../Subscriber';
  import {Subscription} from '../Subscription';
  import {throwError} from '../util/throwError';
  import {ObjectUnsubscribedError} from '../util/ObjectUnsubscribedError';
  
  export class BehaviorSubject<T> extends Subject<T> {
    private _hasError: boolean = false;
    private _err: any;
  
    constructor(private _value: T) {
      super();
    }
  
    getValue(): T {
      if (this._hasError) {
        throwError(this._err);
      } else if (this.isUnsubscribed) {
        throwError(new ObjectUnsubscribedError());
      } else {
        return this._value;
      }
    }
  
    get value(): T {
      return this.getValue();
    }
  
    _subscribe(subscriber: Subscriber<any>): Subscription<T> {
      const subscription = super._subscribe(subscriber);
      if (!subscription) {
        return;
      } else if (!subscription.isUnsubscribed) {
        subscriber.next(this._value);
      }
      return subscription;
    }
  
    _next(value: T): void {
      super._next(this._value = value);
    }
  
    _error(err: any): void {
      this._hasError = true;
      super._error(this._err = err);
    }
  }