Skip to content

Instantly share code, notes, and snippets.

@matzeeable
Last active June 1, 2022 06:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matzeeable/fe9f40b19bb1e9b3e21232fb4059f69c to your computer and use it in GitHub Desktop.
Save matzeeable/fe9f40b19bb1e9b3e21232fb4059f69c to your computer and use it in GitHub Desktop.
Restore function from overriden polyfill (ES5)
function restoreNativeFunctionFromPolyfillOverride(callback) {
var d = document;
var dE = d.documentElement;
var e = d.createElement("iframe");
e.style.display = "none";
dE.appendChild(e);
callback(window, e.contentWindow);
dE.removeChild(e);
}
restoreNativeFunctionFromPolyfillOverride(function(w, c) {
w.Array.from = c.Array.from;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment