Le 15/10/2011 19:52, Andrea Giammarchi a écrit : > naaa, "event" is just a placeholder ... most likely is gonna be > > var event = "@__event__" + Math.random(); Or rather a private name (when this is implemented)? Or with some WeakMap trickeries?
> and most likely that code should be on top with all other native > prototypes shims or improvements. > > the correct this is bound as expected, the click function will have > this === object indeed > > When I wrote any sort of object, i implicity meant any that inherits > from Object.prototype ... are other "objects" ? I don't think so ... I > would never do something like > > alert.on.alert(callback); Actually, in something else than old IE, 'alert' is a regular function and it's [[prototype]] chain is like: alert --> Function.prototype --> Object.prototype --> null So 'alert' should be fine actually. There are indeed other objects that you can create: ---- var o1 = Object.create(null); var o2 = Object.create(o1); var o3 = Object.create(o2); var o4 = Object.create(o2); // both inherit from o2 // etc. ---- None of them contain Object.prototype in their prototype chain and I don't see any strong reason to prevent these objects from emitting events. > you know what I mean ;-) I do. Actually, one of my initial thought was to do something with Object.prototype but I stopped as soon as I remembered that some objects may not inherit from it. > br > > P.S. I just pressed reply but I think I removed your text through > selection ... apologies No worries :-) David _______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

