Le 14/10/2011 22:49, Erik Arvidsson a écrit :
> I love it!
I'm glad to create such a reaction :-)

> With some minor nits. I feel like [[Call]] should map to dispatch/fire.
Not only do I like this idea, but it may solve a problem I had regarding
|this| binding with inherited events.
in "o.myEvent.fire", it's hard to bind "fire" to o because of the middle
thing. No problem if what is bound is the event itself. (unless I need
the "receiver" argument that is about to be dropped?)

> And with some sugar on top to sweeten the deal.
My first intention was not necessarily to propose this for
standardization, so I didn't mention syntax. And also I cannot implement
syntax just with proxies.

> var obj = {
>  onfoo: event(a, b, c) { ... }
> };
I was imagining more something like:
var obj = {
  a: 1,
  event onfoo, // just declaration
  b: null
};

But this idea of a default behavior is an interesting addition. I guess
in my property descriptor, I could make the 'event' field a function for
a default behavior (instead of the dummy 'true')

> I guess I was too lazy here. The idea, which is not very baked was to
> allow a body here as a default action.
>
> Still I like where this is going and we (me and Alex Russel have brain
> stormed this on several occasions).
I realized very soon after sending my email that it actually is very
close from how DOM events are handled in Dart
(http://www.dartlang.org/articles/improving-the-dom/ ) with
"elem.on.click.add".
By the way, do anyone know how the binding with 'elem' is made? Is it
before or after the compilation? Because maybe I miss something, but by
the time you reach "add", you have lost both "elem" and "on"

I'll try to find some time to implement the fire as [[Call]] this week-end.

Thanks,

David
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to