util.promise: Remove the non-standard ability to pass a promise to reject()

This commit is contained in:
Matthew Wild 2018-10-26 09:23:31 +01:00
parent 37bedc7314
commit 8ea77fc0ec

View file

@ -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