var $ = require('../internals/export'); var DESCRIPTORS = require('../internals/descriptors'); var ownKeys = require('../internals/own-keys'); var toIndexedObject = require('../internals/to-indexed-object'); var getOwnPropertyDescriptorModule = require('../internals/object-get-own-property-descriptor'); var createProperty = require('../internals/create-property'); // `Object.getOwnPropertyDescriptors` method // https://tc39.es/ecma262/#sec-object.getownpropertydescriptors $({ target: 'Object', stat: true, sham: !DESCRIPTORS }, { getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) { var O = toIndexedObject(object); var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f; var keys = ownKeys(O); var result = {}; var index = 0; var key, descriptor; while (keys.length > index) { descriptor = getOwnPropertyDescriptor(O, key = keys[index++]); if (descriptor !== undefined) createProperty(result, key, descriptor); } return result; } });