Skip to content

Commit

Permalink
ensure promise#error emits instanceof Error
Browse files Browse the repository at this point in the history
  • Loading branch information
aheckmann committed Jun 7, 2012
1 parent 8465724 commit e5e01ad
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/promise.js
Expand Up @@ -76,9 +76,9 @@ Promise.prototype.complete = function () {
* @api public * @api public
*/ */


Promise.prototype.error = function () { Promise.prototype.error = function (err) {
var args = util.args(arguments); if (!(err instanceof Error)) err = new Error(err);
return this.emit.apply(this, ['err'].concat(args)); return this.emit('err', err);
}; };


/** /**
Expand Down

0 comments on commit e5e01ad

Please sign in to comment.