Proxy handler.has() does not have a receiver argument?

Cyril Auburtin cyril.auburtin at gmail.com
Fri Nov 22 11:55:13 UTC 2019


It's not answering your issue with Proxy but more about multiple inheritance

It can be solved in a static way:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes#Mix-ins

Concrete example here:
https://github.com/pepabo/gmopg/blob/master/src/gmopg.ts#L10

On Fri, Nov 22, 2019 at 4:23 AM #!/JoePea <joe at trusktr.io> wrote:

> After messing with Proxy-on-prototypes for two days, I've just come to
> the conclusion that I probably need to have Proxies on this (the
> receiver) returned from constructors to achieve what I want. At least,
> it's much easier to code it that way. I think it'd be nice to have
> receiver on all inheritance-related traps. That might make some things
> easier.
>
> On Thu, Nov 21, 2019 at 2:55 PM #!/JoePea <joe at trusktr.io> wrote:
> >
> > I really thing that because `has` is about detecting inherited
> > properties, the `receiver` parameter should be included. For things
> > like `ownKeys`, which are not about inheritance, then yeah, let's not
> > add receiver there.
> >
> > I'm trying to implement my own multiple inheritance, but now I
> > stumbled on how to make it send back true for inherited keys when I
> > need to fork the lookup based on instances that are `WeakMap`ed to the
> > `receiver`.
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20191122/6a86fc57/attachment.html>


More information about the es-discuss mailing list