From a738de82e24ea98b59e43d107db1e0cab9658a05 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Fri, 26 Oct 2018 09:23:31 +0100 Subject: util.promise: Remove the non-standard ability to pass a promise to reject() --- util/promise.lua | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'util/promise.lua') diff --git a/util/promise.lua b/util/promise.lua index 14521c4a..a3bc59d2 100644 --- a/util/promise.lua +++ b/util/promise.lua @@ -65,9 +65,7 @@ local function new_resolve_functions(p) local function _reject(e) if resolved then return; end resolved = true; - if is_promise(e) then - e:next(new_resolve_functions(p)); - elseif promise_settle(p, "rejected", next_rejected, p._pending_on_rejected, e) then + if promise_settle(p, "rejected", next_rejected, p._pending_on_rejected, e) then p.reason = e; end end -- cgit v1.2.3