es.object.get-own-property-descriptor.js 724 B

123456789101112131415
  1. var $ = require('../internals/export');
  2. var fails = require('../internals/fails');
  3. var toIndexedObject = require('../internals/to-indexed-object');
  4. var nativeGetOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;
  5. var DESCRIPTORS = require('../internals/descriptors');
  6. var FORCED = !DESCRIPTORS || fails(function () { nativeGetOwnPropertyDescriptor(1); });
  7. // `Object.getOwnPropertyDescriptor` method
  8. // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
  9. $({ target: 'Object', stat: true, forced: FORCED, sham: !DESCRIPTORS }, {
  10. getOwnPropertyDescriptor: function getOwnPropertyDescriptor(it, key) {
  11. return nativeGetOwnPropertyDescriptor(toIndexedObject(it), key);
  12. }
  13. });