core-js
Version:
Standard library
16 lines (13 loc) • 637 B
JavaScript
var toObject = require('../internals/to-object');
var nativeGetPrototypeOf = require('../internals/object-get-prototype-of');
var CORRECT_PROTOTYPE_GETTER = require('../internals/correct-prototype-getter');
var FAILS_ON_PRIMITIVES = require('../internals/fails')(function () { nativeGetPrototypeOf(1); });
// `Object.getPrototypeOf` method
// https://tc39.github.io/ecma262/#sec-object.getprototypeof
require('../internals/export')({
target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES, sham: !CORRECT_PROTOTYPE_GETTER
}, {
getPrototypeOf: function getPrototypeOf(it) {
return nativeGetPrototypeOf(toObject(it));
}
});