From 3059744ca4e528a216a506414ade709afe462b6c Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Fri, 16 Mar 2018 22:31:12 +0000 Subject: util.async: Add comment --- util/async.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/util/async.lua b/util/async.lua index e16d5b24..205db183 100644 --- a/util/async.lua +++ b/util/async.lua @@ -21,6 +21,7 @@ local function runner_continue(thread) -- Running the coroutine failed, which means we have to find the runner manually, -- in order to inform the error handler local level = 0; + -- Find the 'level' of the top-most function (0 == current level, 1 == caller, ...) while debug.getinfo(thread, level, "") do level = level + 1; end ok, runner = debug.getlocal(thread, level-1, 1); assert(ok == "self", "unexpected async state: variable mismatch"); -- cgit v1.2.3