es.reflect.delete-property.js 552 B

123456789101112
  1. var $ = require('../internals/export');
  2. var anObject = require('../internals/an-object');
  3. var getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;
  4. // `Reflect.deleteProperty` method
  5. // https://tc39.es/ecma262/#sec-reflect.deleteproperty
  6. $({ target: 'Reflect', stat: true }, {
  7. deleteProperty: function deleteProperty(target, propertyKey) {
  8. var descriptor = getOwnPropertyDescriptor(anObject(target), propertyKey);
  9. return descriptor && !descriptor.configurable ? false : delete target[propertyKey];
  10. }
  11. });