diff options
author | XhmikosR <xhmikosr@gmail.com> | 2020-05-02 16:56:23 +0300 |
---|---|---|
committer | XhmikosR <xhmikosr@gmail.com> | 2020-11-14 16:54:50 +0300 |
commit | 6d7bc54d222709275b0eb73bd6b974509332247a (patch) | |
tree | 311222b691df1d7d6b237cd6fc74bae721911cd2 /js/src/dom | |
parent | 2e758f64cf7da4a8612992a027704d9f10686b20 (diff) |
Switch to `Set#has()`
Diffstat (limited to 'js/src/dom')
-rw-r--r-- | js/src/dom/event-handler.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/js/src/dom/event-handler.js b/js/src/dom/event-handler.js index 64a061ae69..439a3f1881 100644 --- a/js/src/dom/event-handler.js +++ b/js/src/dom/event-handler.js @@ -22,7 +22,7 @@ const customEvents = { mouseenter: 'mouseover', mouseleave: 'mouseout' } -const nativeEvents = [ +const nativeEvents = new Set([ 'click', 'dblclick', 'mouseup', @@ -69,7 +69,7 @@ const nativeEvents = [ 'error', 'abort', 'scroll' -] +]) /** * ------------------------------------------------------------------------ @@ -151,7 +151,7 @@ function normalizeParams(originalTypeEvent, handler, delegationFn) { typeEvent = custom } - const isNative = nativeEvents.includes(typeEvent) + const isNative = nativeEvents.has(typeEvent) if (!isNative) { typeEvent = originalTypeEvent @@ -273,7 +273,7 @@ const EventHandler = { const $ = getjQuery() const typeEvent = event.replace(stripNameRegex, '') const inNamespace = event !== typeEvent - const isNative = nativeEvents.includes(typeEvent) + const isNative = nativeEvents.has(typeEvent) let jQueryEvent let bubbles = true |