UNPKG

reflect.getprototypeof

Version:

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

22 lines (17 loc) 462 B
'use strict'; var define = require('define-properties'); var getPolyfill = require('./polyfill'); module.exports = function shimGetPrototypeOf() { define( global, { Reflect: {} }, { Reflect: function () { return typeof Reflect !== 'object' || !Reflect; } } ); var polyfill = getPolyfill(); define( Reflect, { getPrototypeOf: polyfill }, { getPrototypeOf: function () { return Reflect.getPrototypeOf !== polyfill; } } ); return polyfill; };