Skip to content

Commit

Permalink
Make all promises inspectable by default
Browse files Browse the repository at this point in the history
Custom promises have a state of "unknown" by default.  All custom
promises have an "inspect" method, regardless of whether one is
specified.
  • Loading branch information
kriskowal committed Jun 11, 2013
1 parent 871a058 commit a4a868e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions q.js
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,11 @@ function makePromise(descriptor, fallback, inspect) {
));
};
}
if (inspect === void 0) {
inspect = function () {
return {state: "unknown"};
};
}

var promise = object_create(makePromise.prototype);

Expand Down

0 comments on commit a4a868e

Please sign in to comment.