As I uderstood, here, in the spec it states that if target is "function",
then trap "apply" is available, to catch function invocations
http://wiki.ecmascript.org/doku.php?id=harmony:virtual_object_api

And that's how it behaves in Forefox -- it just ignores "apply" trap if
target object is not a function.

2016-03-02 14:55 GMT+02:00 Caitlin Potter <[email protected]>:

> What exactly do you mean by “restricted to functions only”?
>
> On Mar 2, 2016, at 7:21 AM, Олег Галабурда <[email protected]> wrote:
>
> Hi!
>
> I'm currently working on project that allows to manipulate objects passed
> from Worker.
> https://github.com/burdiuz/js-worker-interface
>
> It creates wrapper objects that record actions applied to this object and
> send commands to Worker. The problem is, when request is made I cannot know
> what kind of object is this, so in case of function I should give ability
> to make calls on the wrapper object.
> As example, this code:
>
> var api = new WorkerInterface('../webworker.js');
> api.requestTime();
>
> When "requestTime" was requested, it calls "get" and immediately returns
> new Proxy to serve function call. But at time when Proxy is created I do
> not know if that is function or not. Now I passed "apply" limitation by
> adding wrapper function and make Proxy think it works with function.
>
> https://github.com/burdiuz/js-worker-interface/blob/master/source/interface/proxy.js
>
> I found in discussions why "call" trap was rejected, but didn't find
> anything about restricting "apply" trap to functions only.
>
> Thanks!
>
> --
> Oleg Galaburda
>
>
>
> --
> Oleg Galaburda
> http://blog.actualwave.com/
> http://jsinterface.googlecode.com/
> http://guibuilder.org/
> _______________________________________________
> es-discuss mailing list
> [email protected]
> https://mail.mozilla.org/listinfo/es-discuss
>
>
>


-- 
Oleg Galaburda
http://blog.actualwave.com/
http://jsinterface.googlecode.com/
http://guibuilder.org/
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to