Returns a normalised initialState from the localstorage.
@returns {Object}
490193
function getInitialState() {
  if (!window.localStorage) {
    return undefined;
  }

  const storedState = window.localStorage.getItem(storeKey);

  if (!storedState) {
    return undefined;
  }

  const normalisedState = storedState.replace(new RegExp('"isFetching":true', 'g'), '"isFetching":false');
  return JSON.parse(normalisedState);
}
396280
function() {
    var state = $H({
      activeTab: PDoc.Sidebar.getActiveTab(),
      menuScrollOffset: $('menu_pane').scrollTop,
      searchScrollOffset: $('search_results').scrollTop,
      searchValue: $('search').getValue()
    });
    
    return escape(state.toJSON());
  }
465423
function () {
        return {
            position: this.position,
            iteration: this.iteration,
            length: this.length,
            cycles: this.cycles,
            empty: this.empty(),
            eof: this.eof(),
            bof: this.bof(),
            cr: this.cr(),
            ref: this.ref
        };
    }
365106
public void markInitialState() {

        if (!attachedObjects.isEmpty()) {
            for (T t : attachedObjects) {
                if (t instanceof PartialStateHolder) {
                    ((PartialStateHolder) t).markInitialState();
                }
            }
        }
        initialState = true;

    }
731426
public int getInitialSize()
   {
      if (initialSize == null)
         return getMinSize();

      if (initialSize.intValue() > maxSize)
         return maxSize;

      return initialSize.intValue();
   }
29287
function() {
    var i = 2
      , type;
    switch (this.lookahead(i).type) {
      case '{':
      case 'indent':
      case ',':
        return true;
      case 'newline':
        while ('unit' == this.lookahead(++i).type
            || 'newline' == this.lookahead(i).type) ;
        type = this.lookahead(i).type;
        return 'indent' == type || '{' == type;
    }
  }
868428
function getUri1() {
  const startPos = pos;
  let content = [];

  if (checkSC(pos)) content = content.concat(getSC());

  while (pos < tokens[startPos].uri_end) {
    if (checkInterpolation(pos)) content.push(getInterpolation());
    else if (checkUriRaw(pos)) content.push(getUriRaw());
    else break;
  }

  if (checkSC(pos)) content = content.concat(getSC());

  return content;
}
396444
private void prepareInitialState(boolean isNewObject)
    {
        // determine appropriate modification state
        ModificationState initialState;
        if(isNewObject)
        {
            // if object is not already persistent it must be marked as new
            // it must be marked as dirty because it must be stored even if it will not modified during tx
            initialState = StateNewDirty.getInstance();
        }
        else if(isDeleted(oid))
        {
            // if object is already persistent it will be marked as old.
            // it is marked as dirty as it has been deleted during tx and now it is inserted again,
            // possibly with new field values.
            initialState = StateOldDirty.getInstance();
        }
        else
        {
            // if object is already persistent it will be marked as old.
            // it is marked as clean as it has not been modified during tx already
            initialState = StateOldClean.getInstance();
        }
        // remember it:
        modificationState = initialState;
    }
100939
public void initialState() {

        commandBuffer.clear();

        Channel currentChannel = this.channel;
        if (currentChannel != null) {

            ChannelFuture close = currentChannel.close();
            if (currentChannel.isOpen()) {
                close.syncUninterruptibly();
            }
        }
    }
714559
function (callback) {
                var REDUCE_INITIAL_VALUE_INDEX = 1, initialValue = arguments[REDUCE_INITIAL_VALUE_INDEX], thisLength = this.length, index = 0, value;
                if (undefined === initialValue) {
                    value = this[index++];
                } else {
                    value = initialValue;
                }
                for (; index < thisLength; ++index) {
                    value = callback(value, this[index], index, this);
                }
                return value;
            }
946951
function() {
    var finalState = this.finalState, initialState;

    while(true) {
      initialState = get(finalState, 'initialState') || 'start';
      finalState = get(finalState, 'states.' + initialState);

      if (!finalState) { break; }

      this.finalState = finalState;
      this.enterStates.push(finalState);
      this.contexts.push(undefined);
    }
  }
1215406
function () {
      var result = '';
      if (this._string) {
        return this._string;
      } else {
        result = this.scheme === undefined ? result : (result + this.scheme + ':');
        result = this.authority === undefined ? result : (result + '//' + this.authority);
        result = result + this.path;
        result = this.query === undefined ? result : (result + '?' + this.query);
        result = this.fragment === undefined ? result : (result + '#' + this.fragment);
        this._string = result;
        return result;
      }
    }
589138
function preferencesReload() {
          return this.initializedPromise.then(function () {
            this._readFromStorage(this.defaults).then(function (prefObj) {
              if (prefObj) {
                this.prefs = prefObj;
              }
            }.bind(this));
          }.bind(this));
        }
1070132
function createStore(initialState, option) {
    let $state = initialState;
    let $listener = [];
    const $enhancer = option && option.enhancer;
    const $updater = (() => {
        const f1 = option && option.updater;
        const f2 = (s1, s2) => Object.assign({}, s1, s2);
        return f1 || f2;
    })();
    return {
        get listenerCount() {
            return $listener.length;
        },
        getState,
        setState,
        dispatch: usecase,
        usecase,
        subscribe,
    };
    /**
     * Get state
     *
     * @returns {S}
     */
    function getState() {
        return $state;
    }
    /**
     * Set state
     * this api depend on updater
     *
     * @param {Partial<S>} state
     * @returns {S} state
     */
    function setState(state) {
        $state = $updater($state, state);
        return $state;
    }
    /**
     * Listen changing of state and exception of transition
     *
     * @param listener
     * @returns {Function} unsubscribe
     */
    function subscribe(listener) {
        $listener.push(listener);
        return function unsubscribe() {
            $listener = $listener.filter(f => f !== listener);
        };
    }
    /**
     * Publish changing of state to listener
     *
     * @private
     * @param {S} state
     * @param {Error} [error]
     * @returns {void}
     */
    function publish(state, error) {
        $listener.forEach(f => f(state, error));
    }
    /**
     * Compose queue
     *
     * @param {string} [name]
     * @returns {Use}
     * @example
     * usecase('name').use([f1, f2])(param)
     * usecase('name').use(f1).use(f2)(param)
     */
    function usecase(name) {
        let $queue = [];
        let $run;
        return { use };
        function use(arg) {
            let q = [].concat(arg);
            q = $enhancer ? q.map((t) => $enhancer(name, t)) : q;
            q.forEach(t => $queue.push(t));
            return $run || (() => {
                $run = run;
                $run.use = use;
                return $run;
            })();
        }
        function run() {
            next($queue[Symbol.iterator](), arguments[0]);
        }
        ;
    }
    /**
     * Execute one task from iterator then
     * mutation state and publishing
     *
     * @private
     * @param {Iterator<Function>} i
     * @param {*} p
     * @param {Function} [task]
     * @returns {void}
     */
    function next(i, p, task) {
        let iResult = task ? { value: task, done: false } : i.next();
        try {
            if (iResult.done) {
                publish($state);
                return;
            }
            const result = iResult.value($state, p);
            /* Promise(Like) */
            if (result && typeof result.then === 'function') {
                result.then(resolved, rejected);
                publish($state);
                return;
                function resolved(t) {
                    const _t = (typeof t === 'function') && t;
                    next(i, p, _t);
                }
                ;
                function rejected(err) {
                    publish($state, err);
                }
            }
            if (!iResult.done) {
                result && setState(result);
                next(i, p);
                return;
            }
        }
        catch (e) {
            publish($state, e);
        }
    }
}
875324
function getInstanceInitExpression(initInstanceVars) {
  let expressions = initInstanceVars.map((mv) => {
    let name = mv.name.literalToken;
    return parseExpression `this.${name} = ${mv.initializer}`;
  });
  return createCommaExpression(expressions);
}
486689
function(){
    var cached = {};
    var obj = {
        a: [1, 2, 3]
    }, json = "{\"a\":[1,2,3]}";
    
    if (typeof JSON != "undefined" && typeof JSON.stringify === "function" && JSON.stringify(obj).replace((/\s/g), "") === json) {
        // this is a working JSON instance
        return JSON;
    }
    if (Object.toJSON) {
        if (Object.toJSON(obj).replace((/\s/g), "") === json) {
            // this is a working stringify method
            cached.stringify = Object.toJSON;
        }
    }
    
    if (typeof String.prototype.evalJSON === "function") {
        obj = json.evalJSON();
        if (obj.a && obj.a.length === 3 && obj.a[2] === 3) {
            // this is a working parse method           
            cached.parse = function(str){
                return str.evalJSON();
            };
        }
    }
    
    if (cached.stringify && cached.parse) {
        // Only memoize the result if we have valid instance
        getJSON = function(){
            return cached;
        };
        return cached;
    }
    return null;
}
1176366
function getFinalState(selector) {
  if (__own.call(this._finalStates, selector.normalized)) {
    var finalState = this._finalStates[selector.normalized];
  } else {
    var n = selector.parts.length;
    var immediate = false;
    this._startState[this._lastState] = true;
    for (var i = 0; i < n; i++) {
      var part = selector.parts[i];
      if (part === '>') {
        immediate = true;
      } else {
        if (!immediate) {
          this._fa.transition(this._lastState, '', this._lastState);
        }
        this._fa.transition(this._lastState, part, ++this._lastState);
        immediate = false;
      }
    }
    var finalState = this._lastState++;
    this._finalStates[selector.normalized] = finalState;
  }
  return finalState;
}