Skip to content

Commit

Permalink
Ensure that Q.asap functions always return promise
Browse files Browse the repository at this point in the history
  • Loading branch information
kriskowal committed Mar 19, 2014
1 parent 3f62d46 commit 30bb02d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions q.js
Original file line number Diff line number Diff line change
Expand Up @@ -1193,7 +1193,7 @@ function async(makeGenerator) {
return reject(exception);
}
if (result.done) {
return result.value;
return Q(result.value);
} else {
return when(result.value, callback, errback);
}
Expand All @@ -1204,7 +1204,7 @@ function async(makeGenerator) {
result = generator[verb](arg);
} catch (exception) {
if (isStopIteration(exception)) {
return exception.value;
return Q(exception.value);
} else {
return reject(exception);
}
Expand Down

0 comments on commit 30bb02d

Please sign in to comment.