Add LuaValue.load() function for library initialization. Change unit tests to use JavaBytecodeCompiler for lua->Java conversion.

This commit is contained in:
James Roseborough
2010-04-03 03:48:53 +00:00
parent d903a85578
commit 46a9527701
7 changed files with 26 additions and 40 deletions

View File

@@ -87,7 +87,7 @@ public class CompatibiltyTest {
}
public static class JseBytecodeTest extends CompatibiltyTestSuite {
public JseBytecodeTest() {
super(ScriptDrivenTest.PlatformType.JSE);
super(ScriptDrivenTest.PlatformType.LUAJIT);
}
protected void setUp() throws Exception {
super.setUp();

View File

@@ -32,8 +32,7 @@ import java.io.PrintStream;
import junit.framework.TestCase;
import org.luaj.vm2.lib.BaseLib;
import org.luaj.vm2.lib.DebugLib;
import org.luaj.vm2.luajc.LuaJCompiler;
import org.luaj.vm2.luajc.JavaBytecodeCompiler;
abstract
public class ScriptDrivenTest extends TestCase {
@@ -112,7 +111,7 @@ public class ScriptDrivenTest extends TestCase {
return c;
} else {
script = new FileInputStream(file);
return LuaJCompiler.compile( script, name, _G);
return JavaBytecodeCompiler.load( script, name, _G);
}
default:
script = new FileInputStream(file);