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.Lua;
|
||||
abstract
|
||||
public class LNumber extends LValue {
|
||||
|
||||
public static final LString TYPE_NAME = new LString("number");
|
||||
|
||||
/** Compare for equivalence by using lua op comparator */
|
||||
public boolean equals(Object o) {
|
||||
if ( ! ( o instanceof LValue) )
|
||||
@@ -13,4 +15,8 @@ public class LNumber extends LValue {
|
||||
return this.luaBinCmpUnknown(Lua.OP_EQ, v );
|
||||
}
|
||||
|
||||
public LString luaGetType() {
|
||||
return TYPE_NAME;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user