es.reflect.delete-property.js 566 B

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