Rework the main API"s that implement the calling convention. Provide utility methods to get arguments that were supplied, and provide return values. Add a VM interface to clarify the relationship between the VM, things that call the VM, and things that are called by the VM. Make the code more closely aligned with the C++ version.

This commit is contained in:
James Roseborough
2007-07-24 05:06:10 +00:00
parent 56f33b373d
commit 8bf4c82a12
17 changed files with 424 additions and 862 deletions

View File

@@ -95,7 +95,7 @@ public class LuaJTest extends TestCase {
try {
// create closure and execute
Closure c = new Closure( state, p );
state.doCall(c, new LValue[0], 0);
state.doCall(c, new LValue[0]);
final String actualOutput = new String( outputStream.toByteArray() );
final String expectedOutput = getExpectedOutput( testName );

View File

@@ -78,14 +78,14 @@ public class StandardTest extends TestCase {
Builtin.redirectOutput( output );
try {
try {
state.doCall( c, new LValue[0], 0 );
state.doCall( c, new LValue[0] );
} catch ( RuntimeException exn ) {
StackTraceElement[] stackTrace = new StackTraceElement[state.cc+1];
for ( int i = 0; i <= state.cc; ++i ) {
CallFrame call = state.calls[i];
Proto p = call.p;
CallInfo call = state.calls[i];
Proto p = call.closure.p;
int line = p.lineinfo[call.pc];
String func = call.cl.luaAsString();
String func = call.closure.luaAsString();
stackTrace[state.cc - i] = new StackTraceElement(getName(), func, getName()+".lua", line );
}