aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lobject.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/lobject.js b/src/lobject.js
index 8754e20..04a08c0 100644
--- a/src/lobject.js
+++ b/src/lobject.js
@@ -576,6 +576,12 @@ const luaO_pushvfstring = function(L, fmt, argp) {
v instanceof CClosure ||
v instanceof lfunc.UpVal) {
pushstr(L, defs.to_luastring("0x"+v.id.toString(16)));
+ } else if (typeof v === "number") { /* before check object as null is an object */
+ pushstr(L, defs.to_luastring("Number("+v+")"));
+ } else if (typeof v === "string") { /* before check object as null is an object */
+ pushstr(L, defs.to_luastring("String("+JSON.stringify(v)+")"));
+ } else if (typeof v === "boolean") { /* before check object as null is an object */
+ pushstr(L, defs.to_luastring(v?"Boolean(true)":"Boolean(false)"));
} else {
/* user provided object. no id available */
pushstr(L, defs.to_luastring("<id NYI>"));