Comparison

util/promise.lua @ 9550:98de4c2e2627

util.promise: Fix missing parameters
author Matthew Wild <mwild1@gmail.com>
date Thu, 25 Oct 2018 15:24:52 +0100
parent 9549:800c274928bf
child 9558:5fa73fbb047f
comparison
equal deleted inserted replaced
9549:800c274928bf 9550:98de4c2e2627
29 table.insert(self._pending_on_fulfilled, wrap_handler(on_fulfilled, resolve, reject, resolve)); 29 table.insert(self._pending_on_fulfilled, wrap_handler(on_fulfilled, resolve, reject, resolve));
30 table.insert(self._pending_on_rejected, wrap_handler(on_rejected, resolve, reject, reject)); 30 table.insert(self._pending_on_rejected, wrap_handler(on_rejected, resolve, reject, reject));
31 end 31 end
32 32
33 local function next_fulfilled(promise, on_fulfilled, on_rejected, resolve, reject) -- luacheck: ignore 212/on_rejected 33 local function next_fulfilled(promise, on_fulfilled, on_rejected, resolve, reject) -- luacheck: ignore 212/on_rejected
34 wrap_handler(on_fulfilled, resolve, reject)(promise.value); 34 wrap_handler(on_fulfilled, resolve, reject, resolve)(promise.value);
35 end 35 end
36 36
37 local function next_rejected(promise, on_fulfilled, on_rejected, resolve, reject) -- luacheck: ignore 212/on_fulfilled 37 local function next_rejected(promise, on_fulfilled, on_rejected, resolve, reject) -- luacheck: ignore 212/on_fulfilled
38 wrap_handler(on_rejected, resolve, reject)(promise.reason); 38 wrap_handler(on_rejected, resolve, reject, reject)(promise.reason);
39 end 39 end
40 40
41 local function promise_settle(promise, new_state, new_next, cbs, value) 41 local function promise_settle(promise, new_state, new_next, cbs, value)
42 if promise._state ~= "pending" then 42 if promise._state ~= "pending" then
43 return; 43 return;