2013/9/24 Brandon Benvie <[email protected]> > It seems unfortunate that we have to rely on a membrane for something as > simply as `new Proxy(new Date, {}).getDate()` to work. [[Invoke]] as > currently specced gets us somewhere at least. >
You don't necessarily need a full membrane if you want that specific call to work. If a proxy's "get" trap just returns a bound-function (with |this| bound to target), this will work fine. I would postulate that this solution easily covers the 90% case. Yes, methods can be objects with properties in JS, and bound functions won't proxy those, but that isn't the common case. JS programmers have been using function-wrappers since forever (including bound functions since ES5). Bound functions aren't perfect forwarding wrappers either. People seem to cope. Perfect is the enemy of the good and all that ;-)
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

