diff --git a/base b/base index ac93e1a8d..0bb499caf 160000 --- a/base +++ b/base @@ -1 +1 @@ -Subproject commit ac93e1a8d501d778058bae83f49a065b7acf0573 +Subproject commit 0bb499cafa0284a267fa715fabff8b533553051f diff --git a/doc/Events.md b/doc/Events.md index e904e30c2..bef478bfa 100644 --- a/doc/Events.md +++ b/doc/Events.md @@ -41,7 +41,7 @@ for _, widget in ipairs(self) do end end -- If not consumed by children, consume it ourself -return self["on"..event.name](self, unpack(event.args)) +return self["on"..event.name](self, unpack(event.args, 1, event.args.n)) ``` ## Event system diff --git a/frontend/dbg.lua b/frontend/dbg.lua index 06a77665a..dd159fc4e 100644 --- a/frontend/dbg.lua +++ b/frontend/dbg.lua @@ -49,7 +49,7 @@ function Dbg:turnOn() if post_guard then post_guard(...) end - return unpack(values) + return unpack(values, 1, values.n) end end --- Use this instead of a regular Lua @{assert}(). diff --git a/frontend/ui/trapper.lua b/frontend/ui/trapper.lua index ffd91c363..678f01f46 100644 --- a/frontend/ui/trapper.lua +++ b/frontend/ui/trapper.lua @@ -674,7 +674,7 @@ function Trapper:dismissableRunInSubprocess(task, trap_widget_or_string, task_re if task_returns_simple_string then return completed, ret_values else - return completed, unpack(ret_values) + return completed, unpack(ret_values, 1, ret_values.n) end end return completed diff --git a/frontend/ui/uimanager.lua b/frontend/ui/uimanager.lua index 02de899fc..c3d42b147 100644 --- a/frontend/ui/uimanager.lua +++ b/frontend/ui/uimanager.lua @@ -361,7 +361,7 @@ function UIManager:debounce(seconds, immediate, action) else is_scheduled = false if not immediate then - result = action(unpack(args)) + result = action(unpack(args, 1, args.n)) end if not is_scheduled then -- This check is needed because action can recursively call debounced_action_wrapper @@ -376,7 +376,7 @@ function UIManager:debounce(seconds, immediate, action) self:scheduleIn(seconds, scheduled_action) is_scheduled = true if immediate then - result = action(unpack(args)) + result = action(unpack(args, 1, args.n)) end end return result @@ -987,7 +987,7 @@ function UIManager:_checkTasks() -- NOTE: Said task's action might modify _task_queue. -- To avoid race conditions and catch new upcoming tasks during this call, -- we repeatedly check the head of the queue (c.f., #1758). - task.action(unpack(task.args)) + task.action(unpack(task.args, 1, task.args.n)) else -- As the queue is sorted in descending order, it's safe to assume all items are currently future tasks. wait_until = task_time diff --git a/frontend/ui/widget/eventlistener.lua b/frontend/ui/widget/eventlistener.lua index 9d6a2b183..545e6424b 100644 --- a/frontend/ui/widget/eventlistener.lua +++ b/frontend/ui/widget/eventlistener.lua @@ -34,7 +34,7 @@ By default, it's `"on"..Event.name`. function EventListener:handleEvent(event) if self[event.handler] then --print("EventListener:handleEvent:", event.handler, "handled by", debug.getinfo(self[event.handler], "S").short_src, self) - return self[event.handler](self, unpack(event.args)) + return self[event.handler](self, unpack(event.args, 1, event.args.n)) end end