Skip to content

Instantly share code, notes, and snippets.

@baamenabar
Created August 4, 2015 22:04
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 baamenabar/81a7f9071dcb0e3759e2 to your computer and use it in GitHub Desktop.
Save baamenabar/81a7f9071dcb0e3759e2 to your computer and use it in GitHub Desktop.
/**
* This is a simple list of ES5 JS polyfills and snippets I commonly need to add to code for it to run on IE8 or legacy JS engines.
* No particular order.
*/
// Check for __proto__ support.
function a() {}
if ( (new a).__proto__ === a.prototype ){
alert('supported');
}else{
alert('not supported')
}
// add support for getPrototypeOf (use when there's __proto__ support)
if (!Object.getPrototypeOf){
Object.getPrototypeOf = function (obj) {
return obj.__proto__;
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment