Re: [Harmony proxies] Inheritance safe proxies (was: [Harmony proxies] Proxies, prototype chain and inheritance)

2011-03-23 Thread Tom Van Cutsem
Hi David, In one of the first discussion about proxies on this list, the question popped up on whether proxy handlers should implement inheritance (prototype chain walking) themselves, or whether the engine should take care of this, only allowing the handler to control the own layer. The

Re: [Harmony proxies] Proxies, prototype chain and inheritance

2011-03-23 Thread David Bruant
Le 22/03/2011 00:08, David Bruant a écrit : Hi, Proxies can be helpful to emulate multiple inheritance (http://journal.stuffwithstuff.com/2011/02/21/multiple-inheritance-in-javascript/). Long story short, with the get and set traps, you can emulate this multiple inheritance without having

Re: [Harmony proxies] Proxies, prototype chain and inheritance

2011-03-22 Thread Tom Van Cutsem
Another way of solving the inconsistency I see in providing the 6 prototype-climbing traps (getPropertyDescriptor, getPropertyNames, has, get, set and enumerate) and protecting Object.getPrototypeOf and instanceof could be to provide a softer version of proxies where these traps wouldn't be

[Harmony proxies] Inheritance safe proxies (was: [Harmony proxies] Proxies, prototype chain and inheritance)

2011-03-22 Thread David Bruant
Le 22/03/2011 12:58, Tom Van Cutsem a écrit : Another way of solving the inconsistency I see in providing the 6 prototype-climbing traps (getPropertyDescriptor, getPropertyNames, has, get, set and enumerate) and protecting Object.getPrototypeOf and instanceof could be to

[Harmony proxies] Proxies, prototype chain and inheritance

2011-03-21 Thread David Bruant
Hi, Proxies can be helpful to emulate multiple inheritance (http://journal.stuffwithstuff.com/2011/02/21/multiple-inheritance-in-javascript/). Long story short, with the get and set traps, you can emulate this multiple inheritance without having the required prototype chain. However, since

Re: [Harmony proxies] Proxies, prototype chain and inheritance

2011-03-21 Thread Mark S. Miller
Hi David, are you aware of http://wiki.ecmascript.org/doku.php?id=strawman:proxy_instanceof? I just heard from Brendan today that Andreas Gal has encountered some DOM emulation issues that might make us want us to consider this sooner rather than later. How well would it also address the cases