Fix objlen, even though it is unused.
This commit is contained in:
@@ -22,6 +22,7 @@
|
|||||||
package org.luaj.vm;
|
package org.luaj.vm;
|
||||||
|
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.util.Stack;
|
import java.util.Stack;
|
||||||
|
|
||||||
@@ -1752,10 +1753,16 @@ public class LuaState extends Lua {
|
|||||||
* is 0.
|
* is 0.
|
||||||
*/
|
*/
|
||||||
public int objlen(int index) {
|
public int objlen(int index) {
|
||||||
return tostring(index).length();
|
LValue p = topointer( index );
|
||||||
|
switch ( p.luaGetType() ) {
|
||||||
|
case LUA_TTABLE:
|
||||||
|
case LUA_TSTRING:
|
||||||
|
return p.luaLength();
|
||||||
|
default:
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Pops <code>n</code> elements from the stack. <span class="apii">[-n,
|
* Pops <code>n</code> elements from the stack. <span class="apii">[-n,
|
||||||
* +0, <em>-</em>]</span>
|
* +0, <em>-</em>]</span>
|
||||||
|
|||||||
Reference in New Issue
Block a user