Hi David,
What you seem to want is the ability to define new kinds of properties in
addition to data and accessor properties. That is beyond the goal of
proxies.
However, I really don't see why you would want to define your "event
properties" as a third type of property. What would be the problem with
_representing_ your "event properties" as, e.g. accessor properties with an
additional event:true attribute? You state:
"I could return a property descriptor of a regular data property, but it
> looses the nice event enumeration I'm trying to add."
But I don't understand what you mean by that.
I would model your event property descriptors as follows:
getOwnPropertyDescriptor: function(name) {
if (/* name is an event property */) {
return {
event: true,
get: function() {
// we now have access to "receiver", it's |this|
// fire the listeners
}
}
}
}
Cheers,
Tom
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss