aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2017-05-18 13:25:33 +1000
committerdaurnimator <quae@daurnimator.com>2017-05-18 13:26:16 +1000
commit589df5f4e66bf954ded619c6f7bb713ae82514d6 (patch)
tree4fdb4787b96b71861fb760efbc2099055f0b0cb5
parent7191624414a0c2646b0ee319260b91c383027ead (diff)
downloadfengari-589df5f4e66bf954ded619c6f7bb713ae82514d6.tar.gz
fengari-589df5f4e66bf954ded619c6f7bb713ae82514d6.tar.bz2
fengari-589df5f4e66bf954ded619c6f7bb713ae82514d6.zip
src/ltm.js: luaH_getstr takes a TString, not a raw string
-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();
}