Skip to content

Instantly share code, notes, and snippets.

@jonathanmarvens
Created April 2, 2013 01:25
Show Gist options
  • Save jonathanmarvens/5289225 to your computer and use it in GitHub Desktop.
Save jonathanmarvens/5289225 to your computer and use it in GitHub Desktop.
if ( ! (
Object.create &&
( {} ).toString.call( Object.create ) === '[object Function]'
) ) {
Object.create = function ( members ) {
function Class() {}
Class.prototype = members;
return ( new Class() );
};
}
Object.create&&"[object Function]"==={}.toString.call(Object.create)||(Object.create=function(a){function b(){}return b.prototype=a,new b});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment