From 0f09bfdea6d561e5f3d61e6ca5e9be236eb6c6b9 Mon Sep 17 00:00:00 2001 From: Chotiwat Chawannakul Date: Thu, 22 Aug 2013 11:38:56 +0700 Subject: [PATCH] Pass tagged OK text code as the last argument of the callback (for APPENDUID, COPYUID, etc.) --- lib/Connection.js | 1 + lib/Parser.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Connection.js b/lib/Connection.js index 778f655..d0aa3f4 100644 --- a/lib/Connection.js +++ b/lib/Connection.js @@ -1359,6 +1359,7 @@ Connection.prototype._resTagged = function(info) { }); } else { req.cbargs.unshift(err); + req.cbargs.push(info.textCode); req.cb && req.cb.apply(this, req.cbargs); } diff --git a/lib/Parser.js b/lib/Parser.js index 7efa3ab..80ed166 100644 --- a/lib/Parser.js +++ b/lib/Parser.js @@ -300,7 +300,7 @@ function parseTextCode(text, literals) { if (r.length === 1) return r[0]; else - return { key: r[0], val: r[1] }; + return { key: r[0], val: r.length === 2 ? r[1] : r.slice(1) }; } function parseESearch(text, literals) {