Re: Detecting the type of a DOM object

2012-06-25 Thread Brendan Eich
David Bruant wrote: Le 24/06/2012 14:51, Brendan Eich a écrit : David Bruant wrote: Instead of adding a new [[instanceofHint]] internal property, maybe the [[NativeBrand]] could be reused. +1 on that, which suggests [[NativeBrandMatch]] instead of [[InstanceofMatch]]. Your proposal is more

Re: Detecting the type of a DOM object

2012-06-25 Thread Rick Waldron
On Monday, June 25, 2012 at 4:28 AM, Brendan Eich wrote: David Bruant wrote: Le 24/06/2012 14:51, Brendan Eich a écrit : David Bruant wrote: Instead of adding a new [[instanceofHint]] internal property, maybe the [[NativeBrand]] could be reused. +1 on that, which

Re: Detecting the type of a DOM object

2012-06-25 Thread Rick Waldron
On Mon, Jun 25, 2012 at 9:11 AM, David Bruant bruan...@gmail.com wrote: snip Firefox is partially built in JavaScript. This code is considered privileged (by opposition to website JavaScript). More things can be allowed to this JavaScript code. In case the DOM is built in pure browser

Re: Detecting the type of a DOM object

2012-06-25 Thread Allen Wirfs-Brock
On Jun 22, 2012, at 11:01 AM, David Bruant wrote: ... There is a potential security issue. From the wiki [1] (in the case where the instance is a proxy trapping on instanceof): Security issue: the handler is given a reference to the function object (the right-hand side of the instanceof

Re: Detecting the type of a DOM object

2012-06-25 Thread Allen Wirfs-Brock
On Jun 24, 2012, at 5:51 AM, Brendan Eich wrote: David Bruant wrote: Instead of adding a new [[instanceofHint]] internal property, maybe the [[NativeBrand]] could be reused. +1 on that, which suggests [[NativeBrandMatch]] instead of [[InstanceofMatch]]. No, the whole point of

Re: Detecting the type of a DOM object

2012-06-25 Thread David Bruant
Le 25/06/2012 17:36, Allen Wirfs-Brock a écrit : On Jun 22, 2012, at 11:01 AM, David Bruant wrote: ... There is a potential security issue. From the wiki [1] (in the case where the instance is a proxy trapping on instanceof): Security issue: the handler is given a reference to the function

Re: Detecting the type of a DOM object

2012-06-25 Thread David Bruant
Le 25/06/2012 17:49, Allen Wirfs-Brock a écrit : On Jun 24, 2012, at 5:51 AM, Brendan Eich wrote: David Bruant wrote: Instead of adding a new [[instanceofHint]] internal property, maybe the [[NativeBrand]] could be reused. +1 on that, which suggests [[NativeBrandMatch]] instead of

Re: Detecting the type of a DOM object

2012-06-25 Thread Allen Wirfs-Brock
On Jun 25, 2012, at 11:10 AM, David Bruant wrote: Le 25/06/2012 17:49, Allen Wirfs-Brock a écrit : On Jun 24, 2012, at 5:51 AM, Brendan Eich wrote: David Bruant wrote: Instead of adding a new [[instanceofHint]] internal property, maybe the [[NativeBrand]] could be reused. +1 on that, which

Re: Detecting the type of a DOM object

2012-06-25 Thread Tom Van Cutsem
2012/6/25 Allen Wirfs-Brock al...@wirfs-brock.com On Jun 22, 2012, at 11:01 AM, David Bruant wrote: ... There is a potential security issue. From the wiki [1] (in the case where the instance is a proxy trapping on instanceof): Security issue: the handler is given a reference to the

Re: Detecting the type of a DOM object

2012-06-24 Thread Brendan Eich
David Bruant wrote: Instead of adding a new [[instanceofHint]] internal property, maybe the [[NativeBrand]] could be reused. +1 on that, which suggests [[NativeBrandMatch]] instead of [[InstanceofMatch]]. Your proposal is more general but I think we should extend HasInstance only very

Re: Detecting the type of a DOM object

2012-06-24 Thread David Bruant
Le 24/06/2012 14:51, Brendan Eich a écrit : David Bruant wrote: Instead of adding a new [[instanceofHint]] internal property, maybe the [[NativeBrand]] could be reused. +1 on that, which suggests [[NativeBrandMatch]] instead of [[InstanceofMatch]]. Your proposal is more general but I think

Re: Detecting the type of a DOM object

2012-06-22 Thread Allen Wirfs-Brock
I'm going to try to move the discussion of this issue to es-discuss via a separate message as it is mostly about Proxy design. (bcc'ing public-script-coord) the start of this subthread is the following which identifies that historically the [[HasInstance]] extension point has been used (at

Re: Detecting the type of a DOM object

2012-06-22 Thread Boris Zbarsky
On 6/22/12 1:12 PM, Brandon Benvie wrote: While the issue identified may not be particularly related to multiple inheritance, the issue in general I think is a looming one in terms of the goal of being able to self-host the DOM in JS. It seems to be becoming more and more common for various

Re: Detecting the type of a DOM object

2012-06-22 Thread Allen Wirfs-Brock
On Jun 22, 2012, at 10:12 AM, Brandon Benvie wrote: While the issue identified may not be particularly related to multiple inheritance, the issue in general I think is a looming one in terms of the goal of being able to self-host the DOM in JS. It seems to be becoming more and more common

Re: Detecting the type of a DOM object

2012-06-22 Thread David Bruant
Le 22/06/2012 18:13, Allen Wirfs-Brock a écrit : I'm going to try to move the discussion of this issue to es-discuss via a separate message as it is mostly about Proxy design. (bcc'ing public-script-coord) the start of this subthread is the following which identifies that historically the

Re: Detecting the type of a DOM object

2012-06-22 Thread Brendan Eich
Allen Wirfs-Brock wrote: I agree, I don't see that it presents any technical hurdles. Agreed. The DOM is alas built from nominal types, so many people believe (x instaceof I) for some WebIDL-declared interface I, even if that I came from another window or frame, should just work. Of

Re: Detecting the type of a DOM object

2012-06-22 Thread Brandon Benvie
While the issue identified may not be particularly related to multiple inheritance, the issue in general I think is a looming one in terms of the goal of being able to self-host the DOM in JS. It seems to be becoming more and more common for various kinds of partial