cleanup: Use Array.includes() to check for element existence
We can use that newer method where we don't care about the actual position of an element inside the array. (Array.includes() and Array.indexOf() do behave differently in edge cases, for example in the handling of NaN, but those don't matter to us) https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/152
This commit is contained in:

committed by
Florian Müllner

parent
b87455c089
commit
f6b4b96737
@ -128,7 +128,7 @@ function _loadMode(file, info) {
|
||||
let propBlacklist = ['unlockDialog'];
|
||||
for (let prop in _modes[DEFAULT_MODE]) {
|
||||
if (newMode[prop] !== undefined &&
|
||||
propBlacklist.indexOf(prop) == -1)
|
||||
!propBlacklist.includes(prop))
|
||||
_modes[modeName][prop] = newMode[prop];
|
||||
}
|
||||
_modes[modeName]['isPrimary'] = true;
|
||||
|
Reference in New Issue
Block a user