Function identity of non-configurable accessors
bruant.d at gmail.com
Wed Dec 19 08:15:38 PST 2012
Le 19/12/2012 16:34, Brandon Benvie a écrit :
> That's easily solved by making the accessor have a null prototype and
> frozen though.
True, but it makes that you can't re-apply these getters and setters
Since the getter doesn't inherit from Function.prototype any longer, you
have to go through
var call = Function.prototype.call.bind(Function.prototype.call);
Since recontextualizing getter/setter is probably one of their main use
case, I wish this wasn't the chosen solution.
I'd like to point out that recently on Twitter, Eddy Bruel, (who among
other things implemented direct proxies on SpiderMonkey) shared his
trouble understanding the Function.prototype.call.bind trick  If he
has trouble, I'm sure thousands (millions?) of less educated JS devs
will do too.
I prefer the configurable:true solution so far.
More information about the es-discuss