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');
6 var IE_PROTO = sharedKey('IE_PROTO');
7 var ObjectPrototype = Object.prototype;
9 // `Object.getPrototypeOf` method
10 // https://tc39.github.io/ecma262/#sec-object.getprototypeof
11 module.exports = CORRECT_PROTOTYPE_GETTER ? Object.getPrototypeOf : function (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;