aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2018-10-26 09:23:31 +0100
committerMatthew Wild <mwild1@gmail.com>2018-10-26 09:23:31 +0100
commit8ea77fc0ecec86ae1056e57aba47c44c8cfc35fc (patch)
treeb278a7e5ea0311e57b93a14d3e1c9a96a064c260 /util
parent37bedc7314a2f4783d48b76e77510a7d8a0cd037 (diff)
downloadprosody-8ea77fc0ecec86ae1056e57aba47c44c8cfc35fc.tar.gz
prosody-8ea77fc0ecec86ae1056e57aba47c44c8cfc35fc.zip
util.promise: Remove the non-standard ability to pass a promise to reject()
Diffstat (limited to 'util')
-rw-r--r--util/promise.lua4
1 files changed, 1 insertions, 3 deletions
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