Skip to content

Commit

Permalink
change in API.
Browse files Browse the repository at this point in the history
LuaState.setGlobal now receives a String with the name.
It behaves like setglobal macro from c
  • Loading branch information
thiago committed Aug 5, 2004
1 parent 52faa2e commit f70dda6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/java/luajava/JavaFunction.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ public void register(String name) throws LuaException
{
synchronized (L)
{
L.pushString(name);
L.pushJavaFunction(this);
L.setGlobal();
L.setGlobal(name);
L.pop(1);
}
}
}
Expand Down
4 changes: 3 additions & 1 deletion src/java/luajava/LuaState.java
Original file line number Diff line number Diff line change
Expand Up @@ -667,8 +667,10 @@ public synchronized void getGlobal(String global)
getTable(LUA_GLOBALSINDEX.intValue());
}

public synchronized void setGlobal()
public synchronized void setGlobal(String name)
{
pushString(name);
insert(-2);
setTable(LUA_GLOBALSINDEX.intValue());
}

Expand Down

0 comments on commit f70dda6

Please sign in to comment.