function locationGetterSetter(property, preprocess) {
  return function(value) {
    if (isUndefined(value))
      return this[property];

    this[property] = preprocess(value);
    this.$$compose();

    return this;
  };
}
@ngdoc method
@name $location#replace

@description
If called, all changes to $location during current `$digest` will be replacing current history
record, instead of adding new one.