BTF Measurements

Rick Waldron waldron.rick at gmail.com
Tue Mar 13 17:49:06 PDT 2012


On Tue, Mar 13, 2012 at 1:00 PM, Russell Leggett
<russell.leggett at gmail.com>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/

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
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20120313/fe4302c0/attachment-0001.html>


More information about the es-discuss mailing list