aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBenoit Giannangeli <giann008@gmail.com>2017-05-07 09:40:41 +0200
committerBenoit Giannangeli <giann008@gmail.com>2017-05-07 09:40:41 +0200
commitb1a8a4b0435199982d26de4a183600c155619a5a (patch)
tree2fac40908469f9216152d5aa20a646ac7a2c1b74 /src
parent693f073be7408e0eb0422b0e93c60e16b6648045 (diff)
downloadfengari-b1a8a4b0435199982d26de4a183600c155619a5a.tar.gz
fengari-b1a8a4b0435199982d26de4a183600c155619a5a.tar.bz2
fengari-b1a8a4b0435199982d26de4a183600c155619a5a.zip
Sometimes upvalues have js string names
Diffstat (limited to 'src')
-rw-r--r--src/lapi.js6
1 files changed, 4 insertions, 2 deletions
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;
};