Version 1
[yaffs-website] / node_modules / core-js / library / modules / _object-gpo.js
1 // 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)
2 var has         = require('./_has')
3   , toObject    = require('./_to-object')
4   , IE_PROTO    = require('./_shared-key')('IE_PROTO')
5   , ObjectProto = Object.prototype;
6
7 module.exports = Object.getPrototypeOf || function(O){
8   O = toObject(O);
9   if(has(O, IE_PROTO))return O[IE_PROTO];
10   if(typeof O.constructor == 'function' && O instanceof O.constructor){
11     return O.constructor.prototype;
12   } return O instanceof Object ? ObjectProto : null;
13 };