[[Invoke]] and implicit method calls

Allen Wirfs-Brock allen at wirfs-brock.com
Tue Sep 24 12:19:22 PDT 2013


On Sep 24, 2013, at 11:50 AM, Brendan Eich wrote:

>> Brandon Benvie <mailto:bbenvie at mozilla.com>
>> September 24, 2013 11:44 AM
>> 
>> 
>> 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.
> 
> Somewhere half-right and half-wrong, depending on target object details over which a single trap cannot hope to abstract, is still half-wrong. Membranes based on built-in libraries should be easy enough to use.

I think this is a key point.  Things like 'new Proxy(new Date, {}).getDate()' just don't work as expected with direct proxies and we have not been able to fix that while maintaining other important semantic requirements.   If JS programmer have an expectation that they can usefully write such code they are going to be disappointed.  Direct proxies seem to be a fine primitive for implementing membranes and some virtual objects.  They aren't good for things like this Date example.

Allen


More information about the es-discuss mailing list