From e73962317293362be8c10e092199eaefb2f73e6e Mon Sep 17 00:00:00 2001 From: Vytautas Jakutis Date: Sat, 19 Feb 2011 01:05:36 +0800 Subject: [PATCH] fixing openBox method for node-0.4.0 (was broken when the argument "readOnly" was skipped by the user) --- imap.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/imap.js b/imap.js index 39dbeba..f7fc743 100644 --- a/imap.js +++ b/imap.js @@ -402,9 +402,14 @@ ImapConnection.prototype.openBox = function(name, readOnly, cb) { throw new Error('Not connected or authenticated'); if (this._state.status === STATES.BOXSELECTED) this._resetBox(); - if (typeof readOnly !== 'boolean') + if (typeof cb === 'undefined') { + if(typeof readOnly === 'undefined') { + cb = function(){}; + } else { + cb = readOnly; + } readOnly = false; - cb = arguments[arguments.length-1]; + } this._state.status = STATES.BOXSELECTING; this._state.box.name = name;