diff options
author | Kamran Khan <kamran.khan@mongodb.com> | 2016-06-23 17:34:39 -0400 |
---|---|---|
committer | Kamran Khan <kamran.khan@mongodb.com> | 2016-06-23 17:34:39 -0400 |
commit | dd717c8cb6b897a1769fc320734d5d0eb538ce80 (patch) | |
tree | 88310d0e3ccbba862cf2a1aa4d208355dc0bd033 | |
parent | 8a53668a313062adb9b4af48f5d76716e2ca58c8 (diff) | |
download | mongo-dd717c8cb6b897a1769fc320734d5d0eb538ce80.tar.gz |
SERVER-22696 Enable clang-format for code with JS template strings
clang-format 3.8 supports JS template strings, whereas 3.6 did not.
-rw-r--r-- | jstests/core/jssymbol.js | 4 | ||||
-rw-r--r-- | jstests/libs/override_methods/set_majority_read_and_write_concerns.js | 4 | ||||
-rw-r--r-- | jstests/noPassthrough/update_yield1.js | 2 | ||||
-rw-r--r-- | src/mongo/shell/servers.js | 5 |
4 files changed, 1 insertions, 14 deletions
diff --git a/jstests/core/jssymbol.js b/jstests/core/jssymbol.js index 62843405c9a..23c949b0a8e 100644 --- a/jstests/core/jssymbol.js +++ b/jstests/core/jssymbol.js @@ -2,9 +2,7 @@ // (function() { // Exercise Symbol.toPrimitive on DB objects - // clang-format off assert(`${db}` === 'test'); - // clang-format on assert(isNaN(+db)); // Exercise the special Symbol methods and make sure DB.getProperty handles them @@ -20,10 +18,8 @@ assert(isNaN(+a)); assert(+a.v == 1); - // clang-format off assert(`${a.v}` == 1); assert(`${a}` == '[object BSON]'); - // clang-format on // Exercise the special Symbol methods and make sure BSON.resolve handles them assert(db[Symbol.iterator] != 1); diff --git a/jstests/libs/override_methods/set_majority_read_and_write_concerns.js b/jstests/libs/override_methods/set_majority_read_and_write_concerns.js index 232d97e6562..9914d35c73a 100644 --- a/jstests/libs/override_methods/set_majority_read_and_write_concerns.js +++ b/jstests/libs/override_methods/set_majority_read_and_write_concerns.js @@ -35,13 +35,9 @@ if (typeof(jsCode) === "function") { // Load the override file and immediately invoke the supplied function. - // clang-format off newCode = `load("${overridesFile}"); (${jsCode})();`; - // clang-format on } else { - // clang-format off newCode = `load("${overridesFile}"); ${jsCode};`; - // clang-format on } return originalStartParallelShell(newCode, port, noConnect); diff --git a/jstests/noPassthrough/update_yield1.js b/jstests/noPassthrough/update_yield1.js index 29d1e99d46a..0c1f9f16376 100644 --- a/jstests/noPassthrough/update_yield1.js +++ b/jstests/noPassthrough/update_yield1.js @@ -21,12 +21,10 @@ const worksPerYield = 50; // Start a mongod that will yield every 50 work cycles. - // clang-format off var mongod = MongoRunner.runMongod({ setParameter: `internalQueryExecYieldIterations=${worksPerYield}`, profile: 2, }); - // clang-format on assert.neq(null, mongod, 'mongod was unable to start up'); var coll = mongod.getDB('test').update_yield1; diff --git a/src/mongo/shell/servers.js b/src/mongo/shell/servers.js index 2f86ff31962..0972f47be41 100644 --- a/src/mongo/shell/servers.js +++ b/src/mongo/shell/servers.js @@ -793,10 +793,7 @@ var MongoRunner, _startMongod, startMongoProgram, runMongoProgram, startMongoPro if (!Array.contains(allowedExitCodes, returnCode)) { throw new MongoRunner.StopError( - // clang-format off - `MongoDB process on port ${port} exited with error code ${returnCode}`, - // clang-format on - returnCode); + `MongoDB process on port ${port} exited with error code ${returnCode}`, returnCode); } return returnCode; |