LuaValue: add 0x to tojstring() to match Lua

This commit is contained in:
gamax92
2019-08-11 12:01:51 +02:00
committed by asie
parent 89acb5bcb5
commit 2bccb4670e
2 changed files with 3 additions and 3 deletions

View File

@@ -122,11 +122,11 @@ public class LuaClosure extends LuaFunction {
public LuaClosure checkclosure() { public LuaClosure checkclosure() {
return this; return this;
} }
public String tojstring() { public String tojstring() {
return "function: " + p.toString(); return "function: " + p.toString();
} }
private LuaValue[] getNewStack() { private LuaValue[] getNewStack() {
int max = p.maxstacksize; int max = p.maxstacksize;
LuaValue[] stack = new LuaValue[max]; LuaValue[] stack = new LuaValue[max];

View File

@@ -529,7 +529,7 @@ public class LuaValue extends Varargs {
* @see #isstring() * @see #isstring()
* @see #TSTRING * @see #TSTRING
*/ */
public String tojstring() { return typename() + ": " + Integer.toHexString(hashCode()); } public String tojstring() { return typename() + ": 0x" + Integer.toHexString(hashCode()); }
/** Convert to userdata instance, or null. /** Convert to userdata instance, or null.
* @return userdata instance if userdata, or null if not {@link LuaUserdata} * @return userdata instance if userdata, or null if not {@link LuaUserdata}