Changeset

9558:5fa73fbb047f

util.promise: Remove the non-standard ability to pass a promise to reject()
author Matthew Wild <mwild1@gmail.com>
date Fri, 26 Oct 2018 09:23:31 +0100
parents 9557:d7fdd418adf8
children 9559:7c65e3f38e6e
files util/promise.lua
diffstat 1 files changed, 1 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/util/promise.lua	Fri Oct 26 09:23:00 2018 +0100
+++ b/util/promise.lua	Fri Oct 26 09:23:31 2018 +0100
@@ -65,9 +65,7 @@
 	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