massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / core-js / internals / object-get-prototype-of.js
1 var global = require('../internals/global');
2 var hasOwn = require('../internals/has-own-property');
3 var isCallable = require('../internals/is-callable');
4 var toObject = require('../internals/to-object');
5 var sharedKey = require('../internals/shared-key');
6 var CORRECT_PROTOTYPE_GETTER = require('../internals/correct-prototype-getter');
7
8 var IE_PROTO = sharedKey('IE_PROTO');
9 var Object = global.Object;
10 var ObjectPrototype = Object.prototype;
11
12 // `Object.getPrototypeOf` method
13 // https://tc39.es/ecma262/#sec-object.getprototypeof
14 module.exports = CORRECT_PROTOTYPE_GETTER ? Object.getPrototypeOf : function (O) {
15   var object = toObject(O);
16   if (hasOwn(object, IE_PROTO)) return object[IE_PROTO];
17   var constructor = object.constructor;
18   if (isCallable(constructor) && object instanceof constructor) {
19     return constructor.prototype;
20   } return object instanceof Object ? ObjectPrototype : null;
21 };