Permalink
Browse files

Switch argument order to be consistent with other libs

  • Loading branch information...
1 parent f15f753 commit 6144015e00da2140db6c58f3cf2bc23f68484729 Jonas Westerlund committed Jan 19, 2013
Showing with 3 additions and 3 deletions.
  1. +1 −1 lib/channel.js
  2. +1 −1 spec/lib/irc.spec.js
  3. +1 −1 spec/lib/objects.spec.js
View
@@ -201,7 +201,7 @@ function handleJoinReply(callback, msg) {
if (error) {
status |= STATUS.ERROR | STATUS.REMOVE;
error = new Error(error);
- callback(this, error);
+ callback(error, this);
}
return status;
}
View
@@ -360,7 +360,7 @@ describe("irc", function() {
const c1 = irc.channel("#fwdfrom");
const c2 = irc.channel("#fwdto");
const bot = this;
- this.join(c1, function(ch, err) {
+ this.join(c1, function(err, ch) {
err.should.be.an.instanceof(Error);
err.message.should.equal("Forwarding to another channel");
ch.name.should.equal(c2.name);
View
@@ -320,7 +320,7 @@ describe("objects", function() {
ers.forEach(function(e) {
const chan = irc.channel(f("#failjoin%s", e));
chan.client = bot;
- chan.join(function(chn, err) {
+ chan.join(function(err, chn) {
chn.should.be.an.instanceof(irc.Channel);
err.should.be.an.instanceof(Error);
err.message.should.equal(f("Cannot join channel (%s)", e));

0 comments on commit 6144015

Please sign in to comment.