From b1a8a4b0435199982d26de4a183600c155619a5a Mon Sep 17 00:00:00 2001 From: Benoit Giannangeli Date: Sun, 7 May 2017 09:40:41 +0200 Subject: Sometimes upvalues have js string names --- src/lapi.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/lapi.js') diff --git a/src/lapi.js b/src/lapi.js index aa8cf04..a7fbc91 100644 --- a/src/lapi.js +++ b/src/lapi.js @@ -527,7 +527,8 @@ const lua_getupvalue = function(L, funcindex, n) { L.stack[L.top++] = new TValue(val.type, val.value); - return name; + // FIXME: should always be a lua string + return typeof name === 'string' ? defs.to_luastring(name) : name; } return null; }; @@ -544,7 +545,8 @@ const lua_setupvalue = function(L, funcindex, n) { val.type = L.stack[L.top].type; val.value = L.stack[L.top].value; - return name; + // FIXME: should always be a lua string + return typeof name === 'string' ? defs.to_luastring(name) : name; } return null; }; -- cgit v1.2.3-70-g09d2