Add PackageLib.setLuaPath() utility method.

This commit is contained in:
James Roseborough
2007-12-06 21:52:37 +00:00
parent edd8bc33ea
commit 2ee0a1eeed

View File

@@ -96,6 +96,10 @@ public class PackageLib extends LFunction {
globals.put( "package", pckg ); globals.put( "package", pckg );
} }
public static void setLuaPath( String newLuaPath ) {
pckg.put( _PATH, _LUA_PATH );
}
private final int id; private final int id;
private PackageLib( int id ) { private PackageLib( int id ) {
@@ -144,7 +148,7 @@ public class PackageLib extends LFunction {
break; break;
} }
default: default:
throw new RuntimeException( "bad id: "+id ); LuaState.vmerror( "bad package id" );
} }
return false; return false;
} }