From 891529c06adbe43b7c17be90c12b512ab4d955bf Mon Sep 17 00:00:00 2001 From: Matt Ranney Date: Thu, 30 Jun 2011 16:13:57 -0600 Subject: [PATCH] Fix bug with optional callbacks for hmset. --- changelog.md | 4 ++++ index.js | 2 +- package.json | 2 +- test.js | 2 ++ 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/changelog.md b/changelog.md index 0ffd954..fbf825c 100644 --- a/changelog.md +++ b/changelog.md @@ -1,6 +1,10 @@ Changelog ========= +## v0.6.4 - June 30, 2011 + +Fix bug with optional callbacks for hmset. + ## v0.6.2 - June 30, 2011 Bugs fixed: diff --git a/index.js b/index.js index 2f1a067..33ea410 100644 --- a/index.js +++ b/index.js @@ -486,7 +486,7 @@ RedisClient.prototype.send_command = function (command, args, callback) { // probably the fastest way: // client.command([arg1, arg2], cb); (straight passthrough) // send_command(command, [arg1, arg2], cb); - } else if (typeof callback === "undefined") { + } else if (! callback) { // most people find this variable argument length form more convenient, but it uses arguments, which is slower // client.command(arg1, arg2, cb); (wraps up arguments into an array) // send_command(command, [arg1, arg2, cb]); diff --git a/package.json b/package.json index dbf42e5..3ae78e7 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { "name" : "redis", - "version" : "0.6.2", + "version" : "0.6.4", "description" : "Redis client library", "author": "Matt Ranney ", "contributors": [ diff --git a/test.js b/test.js index 32e666c..627f9c2 100644 --- a/test.js +++ b/test.js @@ -395,6 +395,8 @@ tests.HMSET_BUFFER_AND_ARRAY = function () { client.HMSET(key, field1, value1, field2, value2, last(name, require_string("OK", name))); }; +// TODO - add test for HMSET. It is special. Test for all forms as well as optional callbacks + tests.HMGET = function () { var key1 = "test hash 1", key2 = "test hash 2", name = "HMGET";