Comparing version 0.1.0 to 0.1.1
@@ -24,2 +24,3 @@ /** | ||
var count = 0; | ||
var called = 0; | ||
var errList; | ||
@@ -45,3 +46,3 @@ var handler; | ||
} | ||
if (!--count && handler) { | ||
if (++called === count && handler) { | ||
resolve(handler); | ||
@@ -72,3 +73,3 @@ } | ||
handler = fn; | ||
if (!count) { | ||
if (called === count) { | ||
resolve(fn); | ||
@@ -75,0 +76,0 @@ } |
{ | ||
"name" : "listen", | ||
"version" : "0.1.0", | ||
"version" : "0.1.1", | ||
"description" : "Wait for the results of multiple callbacks", | ||
@@ -5,0 +5,0 @@ "author" : "Maximilian Antoni (http://maxantoni.de)", |
@@ -29,2 +29,3 @@ /** | ||
}); |
@@ -161,2 +161,15 @@ /** | ||
'should not confuse argument order': function () { | ||
var spy = sinon.spy(); | ||
var callbackA = this.listener(); | ||
callbackA(null, false); | ||
var callbackB = this.listener(); | ||
callbackB(null, true); | ||
this.then(spy); | ||
sinon.assert.calledWith(spy, null, [false, true]); | ||
}, | ||
'should pass error to given function': function () { | ||
@@ -163,0 +176,0 @@ var spy = sinon.spy(); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13012
399