Created
August 4, 2015 22:04
-
-
Save baamenabar/81a7f9071dcb0e3759e2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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