aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--util/promise.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/util/promise.lua b/util/promise.lua
index 1f48eb9f..2583baa2 100644
--- a/util/promise.lua
+++ b/util/promise.lua
@@ -46,7 +46,9 @@ local function new_resolve_functions(p)
local function _reject(e)
if resolved then return; end
resolved = true;
- if promise_settle(p, "rejected", next_rejected, p._pending_on_rejected, e) then
+ if is_promise(e) then
+ e:next(new_resolve_functions(p));
+ elseif promise_settle(p, "rejected", next_rejected, p._pending_on_rejected, e) then
p.reason = e;
end
end