Created
January 4, 2012 07:01
-
-
Save jarek-foksa/1558886 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
Object.new = function(arg) { | |
var property; | |
var prototype = arg.__prototype__ || object; | |
var object = Object.create(prototype); | |
for (property in arg) { | |
if (arg.hasOwnProperty(property)) { | |
object[property] = arg[property]; | |
} | |
} | |
object.makeNonEnumerable('__name__'); | |
object.makeNonEnumerable('__prototype__'); | |
return object; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment