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
syntax):
element.onevent = () => { ...element... };
or even:
element.onevent = (evt) => { ...evt.target... };
I think think analysis supports the idea that BTFs are widely applicable.
kevin
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss