Please sign in to comment.
Make getfenv more closely match 5.1's behavior
According to http://www.lua.org/manual/5.1/manual.html#pdf-getfenv "The default for f is 1" so when there is no argument passed, we should be passing 1 into debug.getinfo. Without this, Lua complains about the "attempt to perform arithmetic on local 'f' (a nil value)". Hence f should be initialized to 0 when no argument is passed.
- Loading branch information...