1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-09-02 01:42:36 +02:00

Switch to Set#has()

This commit is contained in:
XhmikosR
2020-05-02 16:56:23 +03:00
parent 2e758f64cf
commit 6d7bc54d22
5 changed files with 15 additions and 16 deletions

View File

@@ -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