BTF Measurements

Kevin Smith khs4473 at gmail.com
Wed Mar 14 05:46:34 PDT 2012


>
> As far as I have understood "Total Function Expressions" is supposed to
> return all functions that do not contain "this" in their initial scope and
> that have a "var self=this" trick that is used somewhere inside the
> function (ie function() {var self=this;var b=function()
> {console.log('test')} is not a BTF candidate because self is not used),
> correct ?
>

Sorry, no.  As stated previously, I'm assuming for the purposes of this
analysis that BTFs will be used in cases where (a) we want lexical "this"
and (b) we don't care about "this" at all.  Why in the second case?
 Because BTF syntax will be more concise and will generally express the
intent better.

When I started this research, I wasn't aware of the "tri-lambda" work being
done, and specifically the proposal that there be two short function
syntaxes:  one for classic functions (->) and one for bound this (=>).
 Clearly some of the BTF candidates could go either way, and we really
can't make that distinction in this analysis.

kevin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20120314/b0e1dce0/attachment.html>


More information about the es-discuss mailing list