Comparing version 0.0.2 to 0.0.3
0.0.3 / 2011-10-04 | ||
================== | ||
* bugfix: skip pending that don't have required response callback | ||
0.0.2 / 2011-10-04 | ||
@@ -3,0 +8,0 @@ ================== |
@@ -13,3 +13,3 @@ /*! | ||
*/ | ||
exports.version = '0.0.2'; | ||
exports.version = '0.0.3'; | ||
@@ -183,5 +183,7 @@ | ||
Oath.prototype.complete = function (type, result) { | ||
var fn; | ||
while (this.pending[0]) { | ||
this.pending.shift()[type](result); | ||
fn = this.pending.shift()[type]; | ||
if (fn && 'function' === typeof fn) fn(result); | ||
} | ||
}; |
@@ -5,3 +5,3 @@ { | ||
"description": "Tiny promises.", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"homepage": "http://logicalparadox.github.com/oath", | ||
@@ -8,0 +8,0 @@ "repository": { |
@@ -27,6 +27,7 @@ var assert = require('assert'), | ||
promise({ doctor: 'who' }).then(success, failure); | ||
promise({ doctor: 'who' }) | ||
.then(success, failure); | ||
this.on('exit', function () { | ||
assert.equal(n, 1, 'the success function has been called'); | ||
assert.equal(n, 1, 'the success function has been called twice'); | ||
}); | ||
@@ -53,6 +54,7 @@ }, | ||
promise({ doctor: 'who' }).then(success, failure); | ||
promise({ doctor: 'who' }) | ||
.then(success) // if no failure object skip | ||
.then(success, failure); | ||
this.on('exit', function () { | ||
assert.equal(n, -1, 'the success function has been called'); | ||
assert.equal(n, -1, 'i have successfully failed'); | ||
}); | ||
@@ -59,0 +61,0 @@ }, |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
12684
9
310