From 1cf435df2d74130ec66d09e7910ab9dcc9bf8bd0 Mon Sep 17 00:00:00 2001 From: Felix Schlitter Date: Mon, 20 May 2019 13:20:46 +1200 Subject: [PATCH] Fix purescript-contrib/purescript-aff#174 --- src/Effect/Aff.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Effect/Aff.js b/src/Effect/Aff.js index 3edf456..4cbe0ae 100644 --- a/src/Effect/Aff.js +++ b/src/Effect/Aff.js @@ -498,7 +498,11 @@ var Aff = function () { // bracket count is non-zero then we are in a masked state so it's // impossible to be killed. if (interrupt && interrupt !== tmp && bracketCount === 0) { - step = attempt._1.killed(util.fromLeft(interrupt))(attempt._2); + if (util.isLeft(step)) { + step = attempt._1.killed(util.fromLeft(interrupt))(attempt._2); + } else { + step = attempt._1.completed(util.fromRight(step))(attempt._2); + } } else if (fail) { step = attempt._1.failed(util.fromLeft(fail))(attempt._2); } else {