Improve compatibility with luaj 1.0

This commit is contained in:
James Roseborough
2010-04-18 21:14:02 +00:00
parent 5a416f177c
commit 494e4206c4
3 changed files with 9 additions and 6 deletions

View File

@@ -204,7 +204,7 @@ public class LuaC extends Lua implements LuaCompiler {
lexstate.open_func(funcstate);
/* main func. is always vararg */
funcstate.f.is_vararg = LuaC.VARARG_ISVARARG;
funcstate.f.source = (LuaString) LuaValue.valueOf("@"+name);
funcstate.f.source = (LuaString) LuaValue.valueOf(name);
lexstate.next(); /* read first token */
lexstate.chunk();
lexstate.check(LexState.TK_EOS);

View File

@@ -204,7 +204,7 @@ public class PackageLib extends OneArgFunction {
if ( e < 0 )
e = fname.m_length;
LuaString key = fname.substring(b, e);
LuaValue val = table.get(key);
LuaValue val = table.rawget(key);
if ( val.isnil() ) { /* no such field? */
LuaTable field = new LuaTable(); /* new table for field */
table.set(key, field);