summaryrefslogtreecommitdiff
path: root/src/ltablib.js
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2017-12-12 15:03:02 +1100
committerdaurnimator <quae@daurnimator.com>2017-12-13 15:03:54 +1100
commite438f10592077f8b5432f67ef72a8f1bfbbcdc49 (patch)
tree7755e33334b592e78bc76a20a47fb5e504fe7c74 /src/ltablib.js
parentc5b39b9d292c1a2178aa41c6a95367a81614eb61 (diff)
downloadfengari-e438f10592077f8b5432f67ef72a8f1bfbbcdc49.tar.gz
fengari-e438f10592077f8b5432f67ef72a8f1bfbbcdc49.tar.bz2
fengari-e438f10592077f8b5432f67ef72a8f1bfbbcdc49.zip
src/: Use to_luastring more often instead of manually creating arrays
Diffstat (limited to 'src/ltablib.js')
-rw-r--r--src/ltablib.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ltablib.js b/src/ltablib.js
index 05c9c09..70ff595 100644
--- a/src/ltablib.js
+++ b/src/ltablib.js
@@ -130,7 +130,7 @@ const tmove = function(L) {
const tconcat = function(L) {
let last = aux_getn(L, 1, TAB_R);
- let sep = lauxlib.luaL_optlstring(L, 2, []);
+ let sep = lauxlib.luaL_optlstring(L, 2, lua.to_luastring(""));
let i = lauxlib.luaL_optinteger(L, 3, 1);
last = lauxlib.luaL_optinteger(L, 4, last);
@@ -157,7 +157,7 @@ const pack = function(L) {
for (let i = n; i >= 1; i--) /* assign elements */
lua.lua_seti(L, 1, i);
lua.lua_pushinteger(L, n);
- lua.lua_setfield(L, 1, ["n".charCodeAt(0)]); /* t.n = number of elements */
+ lua.lua_setfield(L, 1, lua.to_luastring("n")); /* t.n = number of elements */
return 1; /* return table */
};