function createImmutableView(obj) {
  let result = obj;
  if (Object.isFrozen && !Object.isFrozen(obj)) {
    result = Object.create(obj);
    Object.freeze(result);
  }
  return result;
}
Creates an immutable view of the underlying object, if the browser
supports immutable objects.
In default mode, writes to this view will fail silently. In strict mode,
they will throw an error.
@param {!Object<K,V>} obj An object.
@return {!Object<K,V>} An immutable view of that object, or the original
    object if this browser does not support immutables.
@template K,V