diff --git a/src/jqLite.js b/src/jqLite.js index 63551875..00fe1cc4 100644 --- a/src/jqLite.js +++ b/src/jqLite.js @@ -783,9 +783,9 @@ forEach({ var eventFns = events[type]; if (!eventFns) { - if (type == 'mouseenter' || type == 'mouseleave') { - events[type] = []; + events[type] = []; + if (type == 'mouseenter' || type == 'mouseleave') { // Refer to jQuery's implementation of mouseenter & mouseleave // Read about mouseenter and mouseleave: // http://www.quirksmode.org/js/events_mouse.html#link8 @@ -801,7 +801,6 @@ forEach({ } else { addEventListenerFn(element, type, handle); - events[type] = []; } eventFns = events[type]; }