Permalink
Browse files

Renamed Client#done() to Client#end()

  • Loading branch information...
1 parent b8b8f20 commit f6437b70ceaedd88eb5ca80d90b6a9954ca9a56d @tj tj committed Sep 7, 2010
Showing with 8 additions and 8 deletions.
  1. +1 −1 examples/google.js
  2. +1 −1 examples/learnboost.js
  3. +6 −6 lib/soda/client.js
View
2 examples/google.js
@@ -23,7 +23,7 @@ browser
assert.ok(~title.indexOf('Hello World'))
})
.testComplete()
- .done(function(err, body, res){
+ .end(function(err){
if (err) throw err;
console.log('done');
});
View
2 examples/learnboost.js
@@ -22,7 +22,7 @@ browser
.assertTextPresent('Account info updated')
.clickAndWait('link=Log out')
.testComplete()
- .done(function(err, res){
+ .end(function(err){
if (err) throw err;
console.log('done');
});
View
12 lib/soda/client.js
@@ -140,14 +140,14 @@ Client.prototype.__defineGetter__('chain', function(){
/**
* Callback `fn(err)` when the queue is complete, or
- * when an exception as occurred.
+ * when an exception has occurred.
*
* @param {Function} fn
* @api public
*/
-Client.prototype.done = function(fn){
- this.done = fn;
+Client.prototype.end = function(fn){
+ this._done = fn;
this.queue.shift()();
};
@@ -176,16 +176,16 @@ Client.prototype.enqueue = function(cmd, args, fn){
try {
fn(body, res);
} catch (err) {
- return self.done(err, body, res);
+ return self._done(err, body, res);
}
}
if (err) {
- self.done(err, body, res);
+ self._done(err, body, res);
} else if (self.queue.length) {
self.queue.shift()();
} else {
- self.done(null, body, res);
+ self._done(null, body, res);
}
});
});

0 comments on commit f6437b7

Please sign in to comment.