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 |
|
10 |
|
11 | module.exports = CORRECT_PROTOTYPE_GETTER ? Object.getPrototypeOf : function (O) {
|
12 | O = toObject(O);
|
13 | if (has(O, IE_PROTO)) return O[IE_PROTO];
|
14 | if (typeof O.constructor == 'function' && O instanceof O.constructor) {
|
15 | return O.constructor.prototype;
|
16 | } return O instanceof Object ? ObjectPrototype : null;
|
17 | };
|