direct_proxies "problem"

Andrea Giammarchi andrea.giammarchi at gmail.com
Sat Jan 12 10:29:20 PST 2013


and in both cases you would have ...

Proxy.isDOMProxy = function (node) {
  try {
    document.documentElement.appendChild(node);
    document.documentElement.removeChild(node);
    return false;
  } catch(gotcha) {
    return true;
  }
};

that's why I have talked about inconsistencies all over at the very
beginning of this thread :)

br






On Sat, Jan 12, 2013 at 10:26 AM, Nathan Wall <nathan.wall at live.com> wrote:

> Nathan wrote:
> >
> > Hey Tom, I think you missed my point. The point was that in David and
> Boris' discussion they agreed that the DOM should throw if it is given a
> Proxy in `appendChild`. That sounded to me like it presumed that the DOM
> had a magical ability to distinguish between DOM objects and their proxies.
> That seemed to contradict the point David made that Proxies should not be
> distinguishable from their targets (e.g. the no `Proxy.isProxy` decision).
> If real DOM had a way to determine if something was a proxy (with a target
> of a *real* DOM node) and throw but there was no way for an emulated DOM
> (in a non-DOM environment) to determine if an object was a proxy with a
> target to an emulated DOM node or just a plain emulated DOM node, then the
> DOM has magical abilities that the emulated DOM can't have. That was my
> concern.
> >
> > David's reply works, though, I think. He stated that since you have to
> create DOM nodes using a method of the DOM itself
> (`document.createElement`, `document.createTextNode`), then emulated DOM
> could track all objects created and compare them against objects passed
> into `appendChild`, and since a proxy would have a different object
> identity from its target, the emulated DOM would have a way to distinguish
> proxies from their targets.
> >
> > Nathan
>
>
> In short, if real DOM can throw when given a proxy of a real DOM node,
> fake DOM should also be able to throw when given a proxy of a fake DOM node.
> _______________________________________________
> 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/20130112/1c87a373/attachment.html>


More information about the es-discuss mailing list