Skip to content

Instantly share code, notes, and snippets.

View edoardocavazza's full-sized avatar
🍔

Edoardo Cavazza edoardocavazza

🍔
View GitHub Profile
@edoardocavazza
edoardocavazza / object-setprototypeof-ie9.js
Last active April 12, 2024 14:24
An "Object.setPrototypeOf" polyfill for IE9
// https://gist.github.com/edoardocavazza/47246856759f2273e48b
(function () {
if (typeof Object.setPrototypeOf === 'undefined' && typeof Object.getOwnPropertyNames === 'function') {
var _exclude = ['length', 'name', 'arguments', 'caller', 'prototype'];
function bindFunction(ctx, fn) {
return function() {
return fn.apply(this, arguments);
}
}