Skip to content

Commit

Permalink
testemGH-1119: Migrated all instanceof Array checks to use `Array.i…
Browse files Browse the repository at this point in the history
…sArray`.
  • Loading branch information
the-t-in-rtf committed May 3, 2017
1 parent b3bc989 commit 60684dc
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/utils/browser-args.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ module.exports = {
return new Validation();
},
dedupeBrowserArgs: function(browserName, browserArgs) {
if (!browserName || !(browserArgs instanceof Array)) { return; }
if (!browserName || !Array.isArray(browserArgs)) { return; }

var argHash = {};

Expand Down Expand Up @@ -64,7 +64,7 @@ module.exports = {

patchArgs = validation.knownBrowser.args;

if (patchArgs instanceof Array) {
if (Array.isArray(patchArgs)) {
validation.knownBrowser.args = browserArgs.concat(validation.knownBrowser.args);
} else if (typeof patchArgs === 'function') {
validation.knownBrowser.args = function() {
Expand All @@ -83,7 +83,7 @@ module.exports = {
}
},
validate: function(browserName, browserArgs, knownBrowsers) {
if (!browserName || !browserArgs || !(knownBrowsers instanceof Array) ||
if (!browserName || !browserArgs || !(Array.isArray(knownBrowsers)) ||
!knownBrowsers.length) { return; }

var i;
Expand Down Expand Up @@ -114,13 +114,13 @@ module.exports = {
var i;
var len;

if (typeof browserArgs !== 'string' && !(browserArgs instanceof Array)) {
if (typeof browserArgs !== 'string' && !(Array.isArray(browserArgs))) {
validation.messages.push('Type error: ' + browserName +
'\'s "args" property should be a string or an array');
} else if (typeof browserArgs === 'string' && !browserArgs.trim()) {
validation.messages.push('Bad value: ' + browserName +
'\'s "args" property should not be empty');
} else if (browserArgs instanceof Array) {
} else if (Array.isArray(browserArgs)) {
len = browserArgs.length;

if (len) {
Expand Down

0 comments on commit 60684dc

Please sign in to comment.