diff options
author | daurnimator <quae@daurnimator.com> | 2017-06-09 14:29:54 +1000 |
---|---|---|
committer | daurnimator <quae@daurnimator.com> | 2017-06-09 14:29:54 +1000 |
commit | 8f188fb2f792223f1a0c1730bd4ac99418d81d74 (patch) | |
tree | 6c5606d38263e6a36b9d6baf47f2804e6ac7511f /src/lauxlib.js | |
parent | 74dd47160960b3f0faa13dd1b61b64af69fde02e (diff) | |
download | fengari-8f188fb2f792223f1a0c1730bd4ac99418d81d74.tar.gz fengari-8f188fb2f792223f1a0c1730bd4ac99418d81d74.tar.bz2 fengari-8f188fb2f792223f1a0c1730bd4ac99418d81d74.zip |
Avoid .concat where simple to do so
Diffstat (limited to 'src/lauxlib.js')
-rw-r--r-- | src/lauxlib.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lauxlib.js b/src/lauxlib.js index 84b625e..2f86720 100644 --- a/src/lauxlib.js +++ b/src/lauxlib.js @@ -110,7 +110,7 @@ const luaL_traceback = function(L, L1, msg, level) { let last = lastlevel(L1); let n1 = last - level > LEVELS1 + LEVELS2 ? LEVELS1 : -1; if (msg) - lua.lua_pushstring(L, msg.concat('\n'.charCodeAt(0))); + lua.lua_pushfstring(L, lua.to_luastring("%s\n"), msg); luaL_checkstack(L, 10, null); lua.lua_pushliteral(L, "stack traceback:"); while (lua.lua_getstack(L1, level++, ar)) { @@ -119,7 +119,7 @@ const luaL_traceback = function(L, L1, msg, level) { level = last - LEVELS2 + 1; /* and skip to last ones */ } else { lua.lua_getinfo(L1, lua.to_luastring("Slnt", true), ar); - lua.lua_pushstring(L, ['\n'.charCodeAt(0), '\t'.charCodeAt(0)].concat(ar.short_src).concat([':'.charCodeAt(0)])); + lua.lua_pushfstring(L, lua.to_luastring("\n\t%s:"), ar.short_src); if (ar.currentline > 0) lua.lua_pushliteral(L, `${ar.currentline}:`); lua.lua_pushliteral(L, " in "); |