Created
September 20, 2012 17:27
-
-
Save westonwatson/3757211 to your computer and use it in GitHub Desktop.
Polyfill for Object.create();
This file contains hidden or 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
if (!Object.create) {Object.create = function (o) {if (arguments.length > 1) {throw new Error('Object.create implementation only accepts the first parameter.');}function F() {}F.prototype = o;return new F();};} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment