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
@ -31,7 +31,7 @@ function getCurrentExtension() {
|
||||
// Search for an occurrence of an extension stack frame
|
||||
// Start at 1 because 0 is the stack frame of this function
|
||||
for (let i = 1; i < stack.length; i++) {
|
||||
if (stack[i].indexOf('/gnome-shell/extensions/') > -1) {
|
||||
if (stack[i].includes('/gnome-shell/extensions/')) {
|
||||
extensionStackLine = stack[i];
|
||||
break;
|
||||
}
|
||||
|
Reference in New Issue
Block a user