Proxying Native Objects: Use case

François REMY at
Thu Jan 31 10:12:58 PST 2013

> In this instance, it's possible for you as a polyfill author to replace
> by your own getter which returns your special
> proxy objects which do what you expect on property set.

For the style case, it's *maybe* possible to do so (in a WebIDL compatible browser at least, not sure it would work on Chrome for example).

> For the dispatchEvent/addEventListener case, it's possible for you to
> override these methods (and maybe the Proxy constructor?) to accept
> proxies the way you want them to.

How would I do so? It seems impossible to me, or at least very tedious. Do not forget that the browser itself will add event handlers on objects via Web Components, Decorators, HTML Attributes, ... 

Being able to catch all cases seems very improbable.

> I think web browsers implementing proxies are/will be sufficiently
> WebIDL compliant to make such a polyfill not that hard to write.
> David 		 	   		  

More information about the es-discuss mailing list