Do js check on value in array by doing type coercion (fix error hidden bubble on Qt5.12.12)

This commit is contained in:
Julien Wadel 2023-01-30 14:07:11 +01:00
parent b52b1ff16f
commit b393b5d0e0

View file

@ -577,23 +577,20 @@ function getExtension (str) {
// Test if a value is included in an array or object.
function includes (obj, value, startIndex) {
obj = ensureArray(obj)
if (startIndex == null) {
startIndex = 0
}
var length = obj.length
for (var i = startIndex; i < length; i++) {
if (
value === obj[i] ||
value == obj[i] ||
// Check `NaN`.
(value !== value && obj[i] !== obj[i])
) {
return true
}
}
return false
}