aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ltm.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ltm.js b/src/ltm.js
index e075e56..3e24c9c 100644
--- a/src/ltm.js
+++ b/src/ltm.js
@@ -95,11 +95,12 @@ const luaT_init = function(L) {
** Return the name of the type of an object. For tables and userdata
** with metatable, use their '__name' metafield, if present.
*/
+const __name = defs.to_luastring('__name', true);
const luaT_objtypename = function(L, o) {
let mt;
if ((o.ttistable() && (mt = o.value.metatable) !== null) ||
(o.ttisfulluserdata() && (mt = o.value.metatable) !== null)) {
- let name = ltable.luaH_getstr(mt, defs.to_luastring('__name', true));
+ let name = ltable.luaH_getstr(mt, lstring.luaS_bless(L, __name));
if (name.ttisstring())
return name.svalue();
}