deepFreeze = function(arg) {
  // NOTE: this compiles to nothing, but hides the possible side effect of
  // deepFreezeInternal_ from the compiler so that the entire call can be
  // removed if the result is not used.
  return {
    valueOf: function() {
      if (!goog.DEBUG) return arg;
      const dupe = deepFreezeInternal_(arg, new Set());
      deepFreezeBreakObjectInternal_(arg);
      return dupe;
    },
  }.valueOf();
}
Deep-freezes the given object, but only in debug mode (and in browsers
that support it). This freeze is deep, and will automatically recurse
into object properties and freeze them. This implementation may return a copy
of the original object, and the return value should be used instead of the
original argument. This implementation only supports literal object
structures, and does not attempt to freeze classes, functions, etc.
@param {T} arg
@return {T}
@template T