Skip to content

Commit

Permalink
fix: ensure to not force unhandled rejections
Browse files Browse the repository at this point in the history
  • Loading branch information
medikoo committed Aug 13, 2018
1 parent 855c460 commit 9b416ea
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ext/promise.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ require("../lib/registered-extensions").promise = function (mode, conf) {

if (resolvedMode === "then") {
var nextTickFailure = function () { nextTick(onFailure); };
promise.then(function (result) {
// Eventual finally needs to be attached to non rejected promise
// (so we not force propagation of unhandled rejection)
promise = promise.then(function (result) {
nextTick(onSuccess.bind(this, result));
}, nextTickFailure);
// If `finally` is a function we attach to it to remove cancelled promises.
Expand Down

0 comments on commit 9b416ea

Please sign in to comment.