On 5/10/07, Dan Webb [EMAIL PROTECTED] wrote:
Any good?
It's awful :P
No, seriously - how often do people copy instance methods around? Is the
minority really enough to justify the mass binding on each instance
creation? How about solving the problem in a real way, by realizing what
you're
On 5/10/07, Ryan Gahl [EMAIL PROTECTED] wrote:
Yeah. What if I want to copy the instance method somewhere else, but I
want it to change scope? If it was bound that I can't bind it to anything
else. So it's a potential blocker in some cases.
Just what I was saying...
Mine had less
No, seriously - how often do people copy instance methods around? Is the
minority really enough to justify the mass binding on each instance
creation? How about solving the problem in a real way, by realizing what
you're doing an compensating for that:
func = a.showA.bind(a)
People do copy
On 5/10/07, Dan Webb [EMAIL PROTECTED] wrote:
People do copy methods around without knowing it all the time: when
assigning event handlers and using the enumerable methods most notably
and this always causes confusion.
Well, that's why we have bindAsEventListener(). I know it's a bit
Dan Webb wrote:
It's not a bad cause, I just think the solution is a performance eater.
Imagine: the loop runs on every object instantiation. It wraps every
function inside another and it needs $A for that. After that, every function
call internally calls another, triggering $A one more
Would it? ;)
The new Event code binds whatever it gets in IE to someElement. It doesn't
know anything about Foo.
I wasn't being very clear -- sorry. Those first two examples
illustrate what would happen if we implemented *both* the stuff in the
events branch as it is now *and* Dan's