16 lines
738 B
JavaScript
16 lines
738 B
JavaScript
'use strict';
|
|
var $ = require('../internals/export');
|
|
var fails = require('../internals/fails');
|
|
var toIndexedObject = require('../internals/to-indexed-object');
|
|
var nativeGetOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;
|
|
var DESCRIPTORS = require('../internals/descriptors');
|
|
|
|
var FORCED = !DESCRIPTORS || fails(function () { nativeGetOwnPropertyDescriptor(1); });
|
|
|
|
// `Object.getOwnPropertyDescriptor` method
|
|
// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
|
|
$({ target: 'Object', stat: true, forced: FORCED, sham: !DESCRIPTORS }, {
|
|
getOwnPropertyDescriptor: function getOwnPropertyDescriptor(it, key) {
|
|
return nativeGetOwnPropertyDescriptor(toIndexedObject(it), key);
|
|
}
|
|
});
|