[Harmony Proxies] Adding a defineProperties derived trap
allen at wirfs-brock.com
Tue Mar 15 10:07:06 PDT 2011
I think there is something deeper lurking behind this issue. Proxies can be used to define objects whose property semantics can be quite different from those of native objects. In some situations the built-in Object. reflection functions are not going to be flexible enough to reify a mirror model of those semantics. If the designers of such proxy-based object abstraction want to expose their unique semantics to reflection-based manipulation they are is going to have define new reflection functions that are specific to their abstraction.
I think we probably need to work through some such scenarios to understand if there are any lurking issues. One thing I'm wondering about is whether any additional "back-door" access to a proxy's handler will be necessary to cross to the meta level. For example, imagine:
OrderedObject.reorder(obj,["prop3","prop2","7","prop12","1"]); //2nd argument re property names in their new order
How does the the reorder function communicate with obj's handler instance without also exposing a meta-level API to the application-level. Actually, private names might provide a solution.
More information about the es-discuss