Add new built-in function type() that returns the name of the type of
the given value as a string. Includes test case.
This commit is contained in:
@@ -5,6 +5,8 @@ import lua.StackState;
|
||||
|
||||
public class LString extends LValue {
|
||||
|
||||
public static final LString TYPE_NAME = new LString("string");
|
||||
|
||||
final String m_string;
|
||||
final int m_hash;
|
||||
|
||||
@@ -53,4 +55,8 @@ public class LString extends LValue {
|
||||
return new LInteger( m_string.length() );
|
||||
}
|
||||
|
||||
public LString luaGetType() {
|
||||
return TYPE_NAME;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user