aboutsummaryrefslogtreecommitdiff
path: root/node_modules/babel-register/node_modules/core-js/library/modules/_object-gpo.js
blob: 27f2a94e88693694ab3595348bf0ca00f26724b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)
var has = require('./_has');
var toObject = require('./_to-object');
var IE_PROTO = require('./_shared-key')('IE_PROTO');
var ObjectProto = Object.prototype;

module.exports = Object.getPrototypeOf || function (O) {
  O = toObject(O);
  if (has(O, IE_PROTO)) return O[IE_PROTO];
  if (typeof O.constructor == 'function' && O instanceof O.constructor) {
    return O.constructor.prototype;
  } return O instanceof Object ? ObjectProto : null;
};