On Mar 13, 2012, at 8:49 PM, Rick Waldron <[email protected]> wrote:
> On Tue, Mar 13, 2012 at 1:00 PM, Russell Leggett <[email protected]> > wrote: > > Can you answer the 'cost' side of the BTF issue? That is if BTF was > really easy, how many times would we have to opt-out so we can use the > default value of "this"? My guess: you will need a lot zeros in place > of X in 0.0X% ;-) > > Sometimes the 'this' is not needed at all; does it ever matter that it > is set to the lexical this? > > > There is a really big use case here that I worry about with BTF: jQuery event > handlers > > For whatever reason, the jQuery guys decided that it would be awesome if > inside the handler, 'this' was bound > to the dom element that the event handler was attached to. > > Yes! Much like the DOM: > > http://jsfiddle.net/rwaldron/KUdYE/ Hah! Shows how long it's been since I've actually written event code directly against the DOM. Still, that only makes for a stronger use case. - Russ > > Rick > > > > $('#foo').bind('click', function() { > alert($(this).text()); > }); > > I think you'll find that pattern all over the place for those using jQuery. > > - Russ > > _______________________________________________ > es-discuss mailing list > [email protected] > https://mail.mozilla.org/listinfo/es-discuss > >
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

