direct_proxies "problem"

Nathan Wall nathan.wall at live.com
Sat Jan 12 10:26:24 PST 2013


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. 		 	   		  


More information about the es-discuss mailing list