function disableGetters(object, objectName, propertyNames, opt_messageSuffix,
                        opt_ignoreMissingProperty) {
  $Array.forEach(propertyNames, function(propertyName) {
    logging.DCHECK(opt_ignoreMissingProperty ||
                       $Object.getOwnPropertyDescriptor(object, propertyName),
                   objectName + ': ' + propertyName);
    var stub = generateDisabledMethodStub(objectName + '.' + propertyName,
                                          opt_messageSuffix);
    stub._is_platform_app_disabled_getter = true;
    $Object.defineProperty(object, propertyName, {
      configurable: true,
      enumerable: false,
      get: stub,
      set: function(value) {
        var descriptor = $Object.getOwnPropertyDescriptor(this, propertyName);
        if (!descriptor || !descriptor.get ||
            descriptor.get._is_platform_app_disabled_getter) {
          // The stub getter is still defined.  Blow-away the property to
          // restore default getter/setter behaviors and re-create it with the
          // given value.
          delete this[propertyName];
          this[propertyName] = value;
        } else {
          // Do nothing.  If some custom getter (not ours) has been defined,
          // there would be no way to read back the value stored by a default
          // setter. Also, the only way to clear a custom getter is to first
          // delete the property.  Therefore, the value we have here should
          // just go into a black hole.
        }
      }
    });
  });
}
/**
 * Replaces the given properties of the passed in object with stubs that log
 * 'not available' warnings to the console and return undefined when gotten. If
 * a property's setter is later invoked, the getter and setter are restored to
 * default behaviors.
 *
 * @param {Object} object The object with properties to disable. The prototype
 *     is preferred.
 * @param {string} objectName The display name to use in the error message
 *     thrown by the getter stub (this is the name that the object is commonly
 *     referred to by web developers, e.g. "document" instead of
 *     "HTMLDocument").
 * @param {Array<string>} propertyNames names of properties to disable.
 * @param {?string=} opt_messageSuffix An optional suffix for the message.
 * @param {boolean=} opt_ignoreMissingProperty True if we allow disabling
 *     getters for non-existent properties.
 */
Replaces the given properties of the passed in object with stubs that log
'not available' warnings to the console and return undefined when gotten. If
a property's setter is later invoked, the getter and setter are restored to
default behaviors.

@param {Object} object The object with properties to disable. The prototype
is preferred.
@param {string} objectName The display name to use in the error message
thrown by the getter stub (this is the name that the object is commonly
referred to by web developers, e.g. "document" instead of
"HTMLDocument").
@param {Array} propertyNames names of properties to disable.
@param {?string=} opt_messageSuffix An optional suffix for the message.
@param {boolean=} opt_ignoreMissingProperty True if we allow disabling
getters for non-existent properties.
Replaces the given properties of the passed in object with stubs that log ' not available ' warnings to the console and return undefined when gotten . If a property ' s setter is later invoked the getter and setter are restored to default behaviors . @param { Object } object The object with properties to disable . The prototype is preferred . @param { string } objectName The display name to use in the error message thrown by the getter stub ( this is the name that the object is commonly referred to by web developers e . g . " document " instead of " HTMLDocument " ) . @param { Array } propertyNames names of properties to disable . @param { ?string = } opt_messageSuffix An optional suffix for the message . @param { boolean = } opt_ignoreMissingProperty True if we allow disabling getters for non - existent properties .
function disableGetters(object, objectName, propertyNames, opt_messageSuffix,
                        opt_ignoreMissingProperty) {
  $Array.forEach(propertyNames, function(propertyName) {
    logging.DCHECK(opt_ignoreMissingProperty ||
                       $Object.getOwnPropertyDescriptor(object, propertyName),
                   objectName + ': ' + propertyName);
    var stub = generateDisabledMethodStub(objectName + '.' + propertyName,
                                          opt_messageSuffix);
    stub._is_platform_app_disabled_getter = true;
    $Object.defineProperty(object, propertyName, {
      configurable: true,
      enumerable: false,
      get: stub,
      set: function(value) {
        var descriptor = $Object.getOwnPropertyDescriptor(this, propertyName);
        if (!descriptor || !descriptor.get ||
            descriptor.get._is_platform_app_disabled_getter) {
          delete this[propertyName];
          this[propertyName] = value;
        } else {
        }
      }
    });
  });
}
function disableGetters ( object , objectName , propertyNames , opt_messageSuffix , opt_ignoreMissingProperty ) { $Array . forEach ( propertyNames , function ( propertyName ) { logging . DCHECK ( opt_ignoreMissingProperty || $Object . getOwnPropertyDescriptor ( object , propertyName ) , objectName + ': ' + propertyName ) ; var stub = generateDisabledMethodStub ( objectName + '.' + propertyName , opt_messageSuffix ) ; stub . _is_platform_app_disabled_getter = true ; $Object . defineProperty ( object , propertyName , { configurable : true , enumerable : false , get : stub , set : function ( value ) { var descriptor = $Object . getOwnPropertyDescriptor ( this , propertyName ) ; if ( ! descriptor || ! descriptor . get || descriptor . get . _is_platform_app_disabled_getter ) { delete this [ propertyName ] ; this [ propertyName ] = value ; } else { } } } ) ; } ) ; }
Replaces the given properties of the passed in object with stubs that log
 'not available' warnings to the console and return undefined when gotten.
Replaces the given properties of the passed in object with stubs that log ' not available ' warnings to the console and return undefined when gotten .
// The stub getter is still defined.  Blow-away the property to // restore default getter/setter behaviors and re-create it with the // given value. // Do nothing.  If some custom getter (not ours) has been defined, // there would be no way to read back the value stored by a default // setter. Also, the only way to clear a custom getter is to first // delete the property.  Therefore, the value we have here should // just go into a black hole.