Improve compatibility with vm1 and C-based lua.
This commit is contained in:
@@ -60,7 +60,7 @@ public class ScriptDrivenTest extends TestCase {
|
||||
default:
|
||||
case JSE:
|
||||
case LUAJIT:
|
||||
_G = org.luaj.vm2.lib.JsePlatform.standardGlobals();
|
||||
_G = org.luaj.vm2.lib.JsePlatform.debugGlobals();
|
||||
break;
|
||||
case JME:
|
||||
_G = org.luaj.vm2.lib.JmePlatform.debugGlobals();
|
||||
@@ -115,7 +115,7 @@ public class ScriptDrivenTest extends TestCase {
|
||||
}
|
||||
default:
|
||||
script = new FileInputStream(file);
|
||||
return LoadState.load(script, "stdin", _G);
|
||||
return LoadState.load(script, "=stdin", _G);
|
||||
}
|
||||
} catch ( Exception e ) {
|
||||
e.printStackTrace();
|
||||
|
||||
@@ -92,7 +92,7 @@ public class Luajvm1CompatibilityTest extends TestCase {
|
||||
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
|
||||
PrintStream printStream = new PrintStream( outputStream );
|
||||
try {
|
||||
org.luaj.vm2.LuaTable _G = org.luaj.vm2.lib.JsePlatform.standardGlobals();
|
||||
org.luaj.vm2.LuaTable _G = org.luaj.vm2.lib.JsePlatform.debugGlobals();
|
||||
LuaThread.getRunning().setfenv(_G);
|
||||
_G.get("package").get("loaders").checktable().insert(1, new org.luaj.vm2.lib.OneArgFunction(_G) {
|
||||
public LuaValue call(LuaValue arg) {
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user