Remove env from LuaFunction, replace with upValiue array, and remove most occurances of setfenv and getfenv.

This commit is contained in:
James Roseborough
2012-09-07 04:36:50 +00:00
parent 244a964af5
commit 3bacea878e
36 changed files with 130 additions and 265 deletions

View File

@@ -71,18 +71,18 @@ public class FragmentsTest extends TestSuite {
public void runFragment( Varargs expected, String script ) {
try {
String name = getName();
LuaTable _G = org.luaj.vm2.lib.jse.JsePlatform.debugGlobals();
org.luaj.vm2.lib.jse.JsePlatform.debugGlobals();
InputStream is = new ByteArrayInputStream(script.getBytes("UTF-8"));
LuaValue chunk ;
switch ( TEST_TYPE ) {
case TEST_TYPE_LUA2JAVA:
chunk = Lua2Java.instance.load(is,name,_G);
chunk = Lua2Java.instance.load(is,name,LuaValue._G);
break;
case TEST_TYPE_LUAJC:
chunk = LuaJC.getInstance().load(is,name,_G);
chunk = LuaJC.getInstance().load(is,name,LuaValue._G);
break;
default:
chunk = LuaC.instance.load( is, name, _G );
chunk = LuaC.instance.load( is, name, LuaValue._G );
Print.print(((LuaClosure)chunk).p);
break;
}