Last change
on this file was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
771 bytes
|
Line | |
---|
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 |
|
---|
7 | var FAILS_ON_PRIMITIVES = fails(function () { nativeGetOwnPropertyDescriptor(1); });
|
---|
8 | var FORCED = !DESCRIPTORS || FAILS_ON_PRIMITIVES;
|
---|
9 |
|
---|
10 | // `Object.getOwnPropertyDescriptor` method
|
---|
11 | // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
|
---|
12 | $({ target: 'Object', stat: true, forced: FORCED, sham: !DESCRIPTORS }, {
|
---|
13 | getOwnPropertyDescriptor: function getOwnPropertyDescriptor(it, key) {
|
---|
14 | return nativeGetOwnPropertyDescriptor(toIndexedObject(it), key);
|
---|
15 | }
|
---|
16 | });
|
---|
Note:
See
TracBrowser
for help on using the repository browser.