BTF Measurements

Kevin Smith khs4473 at
Fri Mar 16 06:44:07 PDT 2012

Hi Aymeric,

I'm glad we're on the same page.   I analyzed the code from that site and
got the same results as you.  The percentage of BTF candidates is 68% of
all function expressions, but the combined BTF candidates and object
literal methods are only 78%.

There are very few object literal methods in this sample, so in order to
explain the 78% we're going to have to dig into the "non-method" forms.

As you point out, event handlers are attached using the following idiom:

    element.onevent = function() { ...this... };

Although they are not trivially convertible to BTFs, event handlers as
above can generally be refactored like this (using a purely expository BTF

    element.onevent = () => { ...element... };

or even:

    element.onevent = (evt) => { };

I think think analysis supports the idea that BTFs are widely applicable.

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

More information about the es-discuss mailing list