aboutsummaryrefslogtreecommitdiffstats
path: root/util/helpers.lua
diff options
context:
space:
mode:
Diffstat (limited to 'util/helpers.lua')
-rw-r--r--util/helpers.lua9
1 files changed, 9 insertions, 0 deletions
diff --git a/util/helpers.lua b/util/helpers.lua
index c8434794..49540c21 100644
--- a/util/helpers.lua
+++ b/util/helpers.lua
@@ -24,4 +24,13 @@ function revert_log_events(events)
events.fire_event, events[events.fire_event] = events[events.fire_event], nil; -- :)
end
+function get_upvalue(f, get_name)
+ local i, name, value = 0;
+ repeat
+ i = i + 1;
+ name, value = debug.getupvalue(f, i);
+ until name == get_name or name == nil;
+ return value;
+end
+
return _M;