UNPKG

object.getprototypeof

Version:

An ES5 mostly-spec-compliant `Object.getPrototypeOf` sham/polyfill/replacement that works in as many engines as possible

15 lines (12 loc) 337 B
'use strict'; var define = require('define-properties'); var getPolyfill = require('./polyfill'); module.exports = function shimGetPrototypeOf() { var polyfill = getPolyfill(); define( Object, { getPrototypeOf: polyfill }, { getPrototypeOf: function () { return Object.getPrototypeOf !== polyfill; } } ); return polyfill; };