>
> 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
"methods":

    element.onclick = function() {
        console.log(this);
    }.bind(this);

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.

kevin
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to