On 7/12/15 12:47 PM, Ashley Gullen wrote:
1. Yes: statically references e.preventDefault
2. Maybe: some dynamic reference like e[str]
3: No: no dynamic references, and no static references to e.preventDefault
Assuming the "maybe" case is rare
Is there data supporting this assumption? I would expect that in
practice in the cases that matter the "maybe" case is the common one.
In particular, I expect that the maybe case includes the following
situations:
1) someObject[someName].call(event);
2) someFunctionThatIsNotInlined(event);
3) event[someName]();
Of these, I expect #2 to be the most common, then #1, then #3... and I
expect #2 to be _very_ common.
A simple way to determine the "no" case could be to identify handlers with
no parameters at all, e.g:
Are these common in the case of the events we're talking about here?
(Also, that's assuming window.event doesn't exist, and while that
assumption is kinda ok today if you're writing cross-browser code that
may cease being the case in the near future if Gecko ends up having to
implement window.event.)
-Boris