Skip to content

Commit

Permalink
Use type safe comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruben Bridgewater committed Jul 22, 2015
1 parent 0908e9a commit 01a3773
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions diff_multi_bench_output.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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
Expand Down
10 changes: 5 additions & 5 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 01a3773

Please sign in to comment.