Skip to content

Commit

Permalink
luastate -> ifCFunction era isCFunction
Browse files Browse the repository at this point in the history
nova funcao isclosed()

luaobject -> mudança no erro da call
  • Loading branch information
thiago committed Aug 9, 2004
1 parent 08b435b commit 1e65ab5
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
16 changes: 14 additions & 2 deletions src/java/luajava/LuaObject.java
Original file line number Diff line number Diff line change
Expand Up @@ -374,8 +374,15 @@ public Object[] call(Object[] args, int nres) throws LuaException

if (err != 0)
{
String str = L.toString(-1);
L.pop(1);
String str;
if (L.isString(-1))
{
str = L.toString(-1);
L.pop(1);
}
else
str = "";

if (err == LuaState.LUA_ERRRUN.intValue())
{
str = "Runtime error. " + str;
Expand All @@ -388,6 +395,11 @@ else if (err == LuaState.LUA_ERRERR.intValue())
{
str = "Error while running the error handler function. " + str;
}
else
{
str = "Lua Error code " + err + ". " + str;
}

throw new LuaException(str);
}

Expand Down
10 changes: 9 additions & 1 deletion src/java/luajava/LuaState.java
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,14 @@ public synchronized void close()
_close(luaState);
this.luaState = null;
}

/**
* Returns <code>true</code> if state is closed.
*/
public synchronized boolean isClosed()
{
return luaState == null;
}

/**
* Return the long representing the LuaState pointer
Expand Down Expand Up @@ -304,7 +312,7 @@ public boolean isFunction(int idx)
return (_isFunction(luaState, idx)!=0);
}

public boolean ifCFunction(int idx)
public boolean isCFunction(int idx)
{
return (_isCFunction(luaState, idx)!=0);
}
Expand Down

0 comments on commit 1e65ab5

Please sign in to comment.