diff options
author | Mike Grundy <michael.grundy@10gen.com> | 2016-02-12 13:50:21 -0500 |
---|---|---|
committer | Mike Grundy <michael.grundy@10gen.com> | 2016-02-19 05:50:29 -0500 |
commit | 2aeae1ee0f91fba6c4f5a6fff6a8bfd26e1600d5 (patch) | |
tree | c603731c3d578dc4c52fb2bacba6984f78d3b118 | |
parent | 70db6ed51f90f627570de9bf32ab8c5cd23886ca (diff) | |
download | mongo-2aeae1ee0f91fba6c4f5a6fff6a8bfd26e1600d5.tar.gz |
SERVER-22597 Fix minor javascript errors found by eslint
-rw-r--r-- | jstests/core/arrayfind8.js | 3 | ||||
-rw-r--r-- | jstests/repl/repl13.js | 3 | ||||
-rw-r--r-- | jstests/repl/repl17.js | 5 | ||||
-rw-r--r-- | jstests/replsets/get_replication_info_helper.js | 2 | ||||
-rw-r--r-- | jstests/tool/gridfs.js | 2 | ||||
-rwxr-xr-x | src/mongo/shell/servers.js | 16 | ||||
-rw-r--r-- | src/mongo/shell/upgrade_check.js | 4 |
7 files changed, 19 insertions, 16 deletions
diff --git a/jstests/core/arrayfind8.js b/jstests/core/arrayfind8.js index 7845bf38f72..e74093d9457 100644 --- a/jstests/core/arrayfind8.js +++ b/jstests/core/arrayfind8.js @@ -1,12 +1,13 @@ // Matching behavior for $elemMatch applied to a top level element. // SERVER-1264 // SERVER-4180 +var debuggingEnabled = false; t = db.jstests_arrayfind8; t.drop(); function debug( x ) { - if ( debuggingEnabled = false ) { + if ( debuggingEnabled ) { printjson( x ); } } diff --git a/jstests/repl/repl13.js b/jstests/repl/repl13.js index 78daae24c32..80d86ffd92d 100644 --- a/jstests/repl/repl13.js +++ b/jstests/repl/repl13.js @@ -1,7 +1,8 @@ // Test update modifier uassert during initial sync. SERVER-4781 +var debuggingEnabled = false; function debug( x ) { - if ( debuggingEnabled = false ) { + if ( debuggingEnabled ) { printjson( x ); } } diff --git a/jstests/repl/repl17.js b/jstests/repl/repl17.js index c7a7be35ffc..651bebdaa09 100644 --- a/jstests/repl/repl17.js +++ b/jstests/repl/repl17.js @@ -16,8 +16,9 @@ slave = rt.start( false ); sd = slave.getDB( 'd' ); function checkSlaveCount( collection, expectedCount ) { - count = sd[ collection ].count(); - if ( debug = false ) { + var count = sd[ collection ].count(); + var debug = false; + if ( debug ) { print( collection + ': ' + count ); } return count == expectedCount; diff --git a/jstests/replsets/get_replication_info_helper.js b/jstests/replsets/get_replication_info_helper.js index b873853b454..c031fb58779 100644 --- a/jstests/replsets/get_replication_info_helper.js +++ b/jstests/replsets/get_replication_info_helper.js @@ -24,7 +24,7 @@ // Just make sure the following fields exist since it would be hard to predict their values assert(replInfo.tFirst, replInfoString); assert(replInfo.tLast, replInfoString); - assert(replInfo.now), replInfoString; + assert(replInfo.now, replInfoString); // calling this function with and without a primary, should provide sufficient code coverage // to catch any JS errors diff --git a/jstests/tool/gridfs.js b/jstests/tool/gridfs.js index fba1654d1eb..c144563c45b 100644 --- a/jstests/tool/gridfs.js +++ b/jstests/tool/gridfs.js @@ -23,7 +23,7 @@ function testGridFS(name) { var rawmd5 = md5sumFile(filename); // upload file (currently calls filemd5 internally) - runMongoProgram.apply(null, ["mongofiles", "--port", mongos.port, "put", filename, '--db', name]); + runMongoProgram("mongofiles", "--port", mongos.port, "put", filename, '--db', name); assert.eq(d.fs.files.count(), 1); var fileObj = d.fs.files.findOne(); diff --git a/src/mongo/shell/servers.js b/src/mongo/shell/servers.js index 8de96e52445..bb552a89afa 100755 --- a/src/mongo/shell/servers.js +++ b/src/mongo/shell/servers.js @@ -842,7 +842,7 @@ function appendSetParameterArgs(argArray) { if (programName.endsWith('mongod') || programName.endsWith('mongos') || programName.startsWith('mongod-') || programName.startsWith('mongos-')) { if (jsTest.options().enableTestCommands) { - argArray.push.apply(argArray, ['--setParameter', "enableTestCommands=1"]); + argArray.push(...['--setParameter', "enableTestCommands=1"]); } if (jsTest.options().authMechanism && jsTest.options().authMechanism != "SCRAM-SHA-1") { var hasAuthMechs = false; @@ -860,7 +860,7 @@ function appendSetParameterArgs(argArray) { } } if (jsTest.options().auth) { - argArray.push.apply(argArray, ['--setParameter', "enableLocalhostAuthBypass=false"]); + argArray.push(...['--setParameter', "enableLocalhostAuthBypass=false"]); } // mongos only options. Note: excludes mongos with version suffix (ie. mongos-3.0). @@ -870,7 +870,7 @@ function appendSetParameterArgs(argArray) { var params = jsTest.options().setParametersMongos.split(","); if (params && params.length > 0) { params.forEach(function(p) { - if (p) argArray.push.apply(argArray, ['--setParameter', p]); + if (p) argArray.push(...['--setParameter', p]); }); } } @@ -880,24 +880,24 @@ function appendSetParameterArgs(argArray) { // set storageEngine for mongod if (jsTest.options().storageEngine) { if ( argArray.indexOf( "--storageEngine" ) < 0 ) { - argArray.push.apply(argArray, ['--storageEngine', jsTest.options().storageEngine]); + argArray.push(...['--storageEngine', jsTest.options().storageEngine]); } } if (jsTest.options().wiredTigerEngineConfigString) { - argArray.push.apply(argArray, ['--wiredTigerEngineConfigString', jsTest.options().wiredTigerEngineConfigString]); + argArray.push(...['--wiredTigerEngineConfigString', jsTest.options().wiredTigerEngineConfigString]); } if (jsTest.options().wiredTigerCollectionConfigString) { - argArray.push.apply(argArray, ['--wiredTigerCollectionConfigString', jsTest.options().wiredTigerCollectionConfigString]); + argArray.push(...['--wiredTigerCollectionConfigString', jsTest.options().wiredTigerCollectionConfigString]); } if (jsTest.options().wiredTigerIndexConfigString) { - argArray.push.apply(argArray, ['--wiredTigerIndexConfigString', jsTest.options().wiredTigerIndexConfigString]); + argArray.push(...['--wiredTigerIndexConfigString', jsTest.options().wiredTigerIndexConfigString]); } // apply setParameters for mongod if (jsTest.options().setParameters) { var params = jsTest.options().setParameters.split(","); if (params && params.length > 0) { params.forEach(function(p) { - if (p) argArray.push.apply(argArray, ['--setParameter', p]); + if (p) argArray.push(...['--setParameter', p]); }); } } diff --git a/src/mongo/shell/upgrade_check.js b/src/mongo/shell/upgrade_check.js index 45bd706b383..7f5d7b17fb0 100644 --- a/src/mongo/shell/upgrade_check.js +++ b/src/mongo/shell/upgrade_check.js @@ -138,7 +138,7 @@ var dbUpgradeCheck = function(dbObj, checkDocs) { // run collection level checks on each collection in the db dbObj.getCollectionNames().forEach(function(collName) { - if (!collUpgradeCheck(dbObj.getCollection(collName)), checkDocs) { + if (!collUpgradeCheck(dbObj.getCollection(collName), checkDocs)) { goodSoFar = false; } }); @@ -198,7 +198,7 @@ DB.prototype.upgradeCheckAllDBs = function(checkDocs) { // run db level checks on each db dbs.databases.forEach(function(dbObj) { - if (!dbUpgradeCheck(self.getSiblingDB(dbObj.name)), checkDocs) { + if (!dbUpgradeCheck(self.getSiblingDB(dbObj.name), checkDocs)) { goodSoFar = false; } }); |