Created
March 4, 2012 01:39
-
-
Save petermichaux/1969805 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
// Instead of this | |
var bar = Object.create(foo); | |
extend(bar, { | |
sayGoodbye: function() { alert("goodbye from " + this.name); } | |
}); | |
// why not write the following and provide a Object.create polyfill that supports the second argument? | |
var bar = Object.create(foo, { | |
sayGoodbye: function() { alert("goodbye from " + this.name); } | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Because the second parameter in your example is not a valid property descriptor