BTF Measurements

Kevin Smith khs4473 at
Tue Mar 13 09:25:38 PDT 2012

> I'm confused by this paragraph. Functions that benefit from 'this'
> binding would reference 'this' or an alias for 'this' right?

In this analysis, functions that reference an "alias" to this (e.g. var
self = this) within an inner scope are counted:

    (function() {
        var self = this;
        (function() { console.log(self); });

This results in 1 BTF candidate (the inner function).

In my analysis, I mention that this methodology will tend to undercount the
BTF candidates, because functions with explicitly bound "this" (through
Function.prototype.bind or other means) will tend to get marked as

    element.onclick = function() {

The analyzer reports 0 BTF candidates, even though we clearly should have
1.  Since the tool undercounts, we can say that the reported numbers offer
a lower bound on BTF candidacy.  The fact that BFT candidacy may be higher
doesn't alter the analysis.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list