Allow null values in arguments to pushCall, expose the underlying storage in LTable to simplify add-ons until the lTable is finished.

This commit is contained in:
James Roseborough
2007-07-02 14:39:17 +00:00
parent 2fe87230d8
commit 7aab64e6d3

View File

@@ -13,7 +13,7 @@ public class LTable extends LValue {
/** Metatable tag for intercepting table sets */
private static final LString TM_NEWINDEX = new LString("__newindex");
private Hashtable m_hash = new Hashtable();
public Hashtable m_hash = new Hashtable();
private LTable m_metatable;
public LTable() {
@@ -27,6 +27,16 @@ public class LTable extends LValue {
m_hash.put( new LString(key), value );
}
/** Utility method for putting something in a numbered slot */
public void put(int i, LValue value) {
m_hash.put( new Integer(i), value );
}
/** Utility method to directly get the value in a table, without metatable calls */
public LValue get(String key) {
return (LValue) m_hash.get( new LString(key) );
}
public void luaSetTable(CallFrame call, int base, LValue table, LValue key, LValue val) {
if ( m_metatable != null ) {
if ( ! m_hash.containsKey(key) ) {