diff --git a/lib/shared/Configurator.js b/lib/shared/Configurator.js index b42f1ae6cb..f1ca92a4dd 100644 --- a/lib/shared/Configurator.js +++ b/lib/shared/Configurator.js @@ -67,7 +67,7 @@ class Configurator { let enabled = true; if (typeof options === "string") { this.options.filter = options; - } else if (options instanceof Array) { + } else if (Array.isArray(options)) { this.options.filter = options.join(); } else if (typeof options === "object") { if (options == null) { @@ -616,7 +616,7 @@ class Configurator { // if needed we must go deeper into the object. if (show === false) { if ( - !(item instanceof Array) && + !Array.isArray(item) && typeof item !== "string" && typeof item !== "boolean" && item instanceof Object @@ -632,7 +632,7 @@ class Configurator { visibleInSet = true; const value = this._getValue(newPath); - if (item instanceof Array) { + if (Array.isArray(item)) { this._handleArray(item, value, newPath); } else if (typeof item === "string") { this._makeTextInput(item, value, newPath); diff --git a/test/Network.test.js b/test/Network.test.js index a2b3228df7..3ae86968a8 100644 --- a/test/Network.test.js +++ b/test/Network.test.js @@ -49,7 +49,7 @@ function merge(a, b) { * Load legacy-style (i.e. not module) javascript files into the given context. */ function include(list, context) { - if (!(list instanceof Array)) { + if (!Array.isArray(list)) { list = [list]; }