diff --git a/test/cancelable.js b/test/cancelable.js index 9afe9cfc..142cdbe2 100644 --- a/test/cancelable.js +++ b/test/cancelable.js @@ -38,6 +38,22 @@ buster.testCase('when/cancelable', { done(); } ); + }, + + 'should propagate the unaltered resolution value': function(done) { + var c = cancelable(when.defer(), function() { return false; }); + c.resolve(true); + + c.then( + function(val) { + assert(val); + done(); + }, + function() { + buster.fail(); + done(); + } + ); } }); diff --git a/when.js b/when.js index 37b5b78f..d2141224 100644 --- a/when.js +++ b/when.js @@ -110,7 +110,7 @@ define(function() { var nextValue; try { - nextValue = callback && callback(value); + if(callback) nextValue = callback(value); return promise(nextValue === undef ? value : nextValue); } catch(e) { return rejected(e);