Re: Converting an existing object to a proxy

2011-05-28 Thread LungZeno
On Sat, May 28, 2011 at 2:05 AM, Sean Eagan seaneag...@gmail.com wrote:
 On Fri, May 27, 2011 at 12:43 PM, Sean Eagan seaneag...@gmail.com wrote:
 Of course you could go the other way, and remove the default trap
 implementations.  All objects could have the same internal method
 implementation regardless of whether or not they are a proxy.  Within
 each internal method there could be a check as to whether the object
 is a proxy (has a [[Handler]]) AND has the trap, if so, it is invoked,
 otherwise the default pseudocode is performed.

 The pseudocode for checking if the object has a [[Handler]], and if
 that [[Handler]] has a trap, and then invoking the trap could all be
 factored out into a [[Trap]] (or something) internal method, which
 takes a trap name, and a list of arguments to pass to the trap, and
 returns whether or not the object has the trap, and if so, also a
 return value from the trap.  This would make for a very concise and
 clear spec with regard to proxies, and it would be relatively easy to
 update the current proposal to do this.

Another way, every object has a [[Proxify]] internal method
corresponding to Object.createFrom. Host objects have their
[[Proxify]] different to native objects. [[Proxify]] can also be
trapped w.r.t. invoking Proxy.createFrom(aProxy, handler, proto).

 Thanks,
 Sean Eagan
 ___
 es-discuss mailing list
 es-discuss@mozilla.org
 https://mail.mozilla.org/listinfo/es-discuss

___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss


some question about module loaders

2010-12-22 Thread LungZeno
I have read http://wiki.ecmascript.org/doku.php?id=strawman:module_loaders

Which is src in evalScript(src : String) : any;url or source code?
Can programmer eval code through ModuleLoader like eval operator?
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss