Improve compatibility with vm1 and C-based lua.

This commit is contained in:
James Roseborough
2010-04-25 22:40:04 +00:00
parent 79b0294207
commit 29d6f2ce58
9 changed files with 24 additions and 20 deletions

View File

@@ -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();

View File

@@ -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) {