On 10/26/2013 7:44 AM, Michaël Rouges wrote:
Knowing that every function is an object, I am surprised that the Object.create() method doesn't really allow cloning function.

Object.create creates Objects. You run into the same limitation when trying to create Arrays with Object.create (doesn't work correctly). You're looking for Function.create [1], which doesn't yet exist (although you can get pretty close using Proxies for functions).

[1] A sample implementation of Function.create can be found on http://wiki.ecmascript.org/doku.php?id=strawman:name_property_of_functions
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to