use util.isDate instead of instanceof

fork
Brian White 12 years ago
parent 1a1d51c42a
commit ce072c5d84

@ -1,4 +1,5 @@
var assert = require('assert'),
isDate = require('util').isDate,
inspect = require('util').inspect,
inherits = require('util').inherits,
Socket = require('net').Socket,
@ -795,8 +796,8 @@ ImapConnection.prototype.append = function(data, options, cb) {
cmd += " (\\" + options.flags.join(' \\') + ")";
}
if (options.date) {
if (!(options.date instanceof Date))
throw new Error('Expected null or Date object for date');
if (!isDate(options.date))
throw new Error("`date` isn't a Date object");
cmd += ' "';
cmd += options.date.getDate();
cmd += '-';

Loading…
Cancel
Save