Last change
on this file since 6a3a178 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
770 bytes
|
Line | |
---|
1 | var has = require('../internals/has');
|
---|
2 | var toObject = require('../internals/to-object');
|
---|
3 | var sharedKey = require('../internals/shared-key');
|
---|
4 | var CORRECT_PROTOTYPE_GETTER = require('../internals/correct-prototype-getter');
|
---|
5 |
|
---|
6 | var IE_PROTO = sharedKey('IE_PROTO');
|
---|
7 | var ObjectPrototype = Object.prototype;
|
---|
8 |
|
---|
9 | // `Object.getPrototypeOf` method
|
---|
10 | // https://tc39.es/ecma262/#sec-object.getprototypeof
|
---|
11 | // eslint-disable-next-line es/no-object-getprototypeof -- safe
|
---|
12 | module.exports = CORRECT_PROTOTYPE_GETTER ? Object.getPrototypeOf : function (O) {
|
---|
13 | O = toObject(O);
|
---|
14 | if (has(O, IE_PROTO)) return O[IE_PROTO];
|
---|
15 | if (typeof O.constructor == 'function' && O instanceof O.constructor) {
|
---|
16 | return O.constructor.prototype;
|
---|
17 | } return O instanceof Object ? ObjectPrototype : null;
|
---|
18 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.