BTF Measurements

Russell Leggett russell.leggett at gmail.com
Tue Mar 13 20:50:58 PDT 2012


On Mar 13, 2012, at 8:49 PM, Rick Waldron <waldron.rick at gmail.com> wrote:

> 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/

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
> 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/ab8e3cd8/attachment.html>


More information about the es-discuss mailing list