Skip to content

Commit 1409e0a

Browse files
committed
Fix potential false negative in unhandled rejection reporting
1 parent f6d74d2 commit 1409e0a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/makePromise.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -553,12 +553,13 @@ define(function() {
553553
Rejected.prototype._state = -1;
554554

555555
Rejected.prototype.fold = function(f, z, c, to) {
556-
this._unreport();
557556
to.become(this);
558557
};
559558

560559
Rejected.prototype.when = function(cont) {
561-
this._unreport();
560+
if(typeof cont.rejected === 'function') {
561+
this._unreport();
562+
}
562563
runContinuation1(cont.rejected, this, cont.receiver, cont.resolver);
563564
};
564565

0 commit comments

Comments
 (0)