Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 01b10d7

Browse files
committed
refactor(jqLite): remove code duplication
1 parent 2a5dbbd commit 01b10d7

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/jqLite.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -783,9 +783,9 @@ forEach({
783783
var eventFns = events[type];
784784

785785
if (!eventFns) {
786-
if (type == 'mouseenter' || type == 'mouseleave') {
787-
events[type] = [];
786+
events[type] = [];
788787

788+
if (type == 'mouseenter' || type == 'mouseleave') {
789789
// Refer to jQuery's implementation of mouseenter & mouseleave
790790
// Read about mouseenter and mouseleave:
791791
// http://www.quirksmode.org/js/events_mouse.html#link8
@@ -801,7 +801,6 @@ forEach({
801801

802802
} else {
803803
addEventListenerFn(element, type, handle);
804-
events[type] = [];
805804
}
806805
eventFns = events[type];
807806
}

0 commit comments

Comments
 (0)