emoji-mart-lazyload/src/polyfills/objectGetPrototypeOf.js

13 lines
282 B
JavaScript
Raw Normal View History

2017-09-17 08:54:22 +00:00
const _Object = Object
2017-10-07 04:02:02 +00:00
export default _Object.getPrototypeOf ||
function(O) {
O = Object(O)
2017-09-17 08:54:22 +00:00
2017-10-07 04:02:02 +00:00
if (typeof O.constructor === 'function' && O instanceof O.constructor) {
return O.constructor.prototype
}
2017-09-17 08:54:22 +00:00
2017-10-07 04:02:02 +00:00
return O instanceof Object ? Object.prototype : null
}