There is some patches to fix compatibility for Lua 5.1 & 5.2. Not fully tested but seems to work well with my test cases under 5.1.5, 5.2.1, JIT 2.0.0 (with and without 5.2 compat).
This looks good. I want to double-check the standard behavior of getfenv in 5.1.x and 5.2 before merging, but I should get to it in a few days. Thanks!
There is some patches to fix compatibility for Lua 5.1 & 5.2. Not fully tested but seems to work well with my test cases under 5.1.5, 5.2.1, JIT 2.0.0 (with and without 5.2 compat).