From 01a377383bc97522665059ec85b71985d4e2f76e Mon Sep 17 00:00:00 2001 From: Ruben Bridgewater Date: Wed, 22 Jul 2015 16:43:01 +0200 Subject: [PATCH] Use type safe comparison --- diff_multi_bench_output.js | 4 ++-- test/test.js | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/diff_multi_bench_output.js b/diff_multi_bench_output.js index 8eab0a2c69..89b6be479c 100755 --- a/diff_multi_bench_output.js +++ b/diff_multi_bench_output.js @@ -49,7 +49,7 @@ before_lines.forEach(function(b, i) { var isNaN = !num && num !== 0; return !isNaN; }); - if (ops.length != 2) return; + if (ops.length !== 2) return; var delta = ops[1] - ops[0]; var pct = ((delta / ops[0]) * 100).toPrecision(3); @@ -60,7 +60,7 @@ before_lines.forEach(function(b, i) { pct = humanize_diff(pct, '%'); console.log( // name of test - command_name(a_words) == command_name(b_words) + command_name(a_words) === command_name(b_words) ? command_name(a_words) + ':' : '404:', // results of test diff --git a/test/test.js b/test/test.js index 5bcc32fd51..ffb097bda4 100644 --- a/test/test.js +++ b/test/test.js @@ -204,7 +204,7 @@ tests.FLUSHDB = function () { tests.INCR = function () { var name = "INCR"; - if (bclient.reply_parser.name == "hiredis") { + if (bclient.reply_parser.name === "hiredis") { console.log("Skipping INCR buffer test with hiredis"); return next(name); } @@ -371,7 +371,7 @@ tests.MULTI_6 = function () { tests.MULTI_7 = function () { var name = "MULTI_7"; - if (bclient.reply_parser.name != "javascript") { + if (bclient.reply_parser.name !== "javascript") { console.log("Skipping wire-protocol test for 3rd-party parser"); return next(name); } @@ -467,7 +467,7 @@ tests.FWD_ERRORS_1 = function () { client3.on("message", function (channel, data) { console.log("incoming"); - if (channel == name) { + if (channel === name) { assert.equal(data, "Some message"); throw toThrow; } @@ -1286,11 +1286,11 @@ tests.SUBSCRIBE_CLOSE_RESUBSCRIBE = function () { console.log("c1 is ready", count); count++; - if (count == 1) { + if (count === 1) { c2.publish("chan1", "hi on channel 1"); return; - } else if (count == 2) { + } else if (count === 2) { c2.publish("chan2", "hi on channel 2"); } else {