Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- getfenv = getfenv or function(f)
- f = (type(f) == 'function' and f or debug.getinfo(f + 1, 'f').func)
- local name, val
- local up = 0
- repeat
- up = up + 1
- name, val = debug.getupvalue(f, up)
- until name == '_ENV' or name == nil
- return val
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement