Skip to content

Commit

Permalink
Merge pull request kriskowal#499 from kriskowal/kriskowalgh-497
Browse files Browse the repository at this point in the history
Ensure that Q.asap functions always return promise
  • Loading branch information
kriskowal committed Apr 7, 2014
2 parents 5dc1657 + 30bb02d commit cdb9dc9
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 cdb9dc9

Please sign in to comment.