diff options
author | daurnimator <quae@daurnimator.com> | 2017-04-26 23:42:18 +1000 |
---|---|---|
committer | daurnimator <quae@daurnimator.com> | 2017-04-26 23:56:52 +1000 |
commit | 2c6ad8ae871ec8f511f1b983867fccf031bf38b3 (patch) | |
tree | eacefbe085e0e551e4460046bd474395fcc74a32 /src/lstrlib.js | |
parent | a70eeebe4aa5014e08b67da7ec07be903c3cf6a5 (diff) | |
download | fengari-2c6ad8ae871ec8f511f1b983867fccf031bf38b3.tar.gz fengari-2c6ad8ae871ec8f511f1b983867fccf031bf38b3.tar.bz2 fengari-2c6ad8ae871ec8f511f1b983867fccf031bf38b3.zip |
Move jsstring() from lobject.js to defs.js; export from lua.js
Diffstat (limited to 'src/lstrlib.js')
-rw-r--r-- | src/lstrlib.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lstrlib.js b/src/lstrlib.js index 370e672..5bd08d4 100644 --- a/src/lstrlib.js +++ b/src/lstrlib.js @@ -346,7 +346,7 @@ const str_format = function(L) { lua.lua_pop(L, 1); /* remove result from 'luaL_tolstring' */ } else { /* format the string into 'buff' */ // TODO: will failt if s is not valid UTF-8 - concat(b, lua.to_luastring(sprintf(String.fromCharCode(...form), lobject.jsstring(s)))); + concat(b, lua.to_luastring(sprintf(String.fromCharCode(...form), lua.to_jsstring(s)))); lua.lua_pop(L, 1); /* remove result from 'luaL_tolstring' */ } } @@ -642,13 +642,13 @@ const str_reverse = function(L) { const str_lower = function(L) { // TODO: will fail on invalid UTF-8 - lua.lua_pushstring(L, lua.to_luastring(lobject.jsstring(lauxlib.luaL_checkstring(L, 1)).toLowerCase())); + lua.lua_pushstring(L, lua.to_luastring(lua.to_jsstring(lauxlib.luaL_checkstring(L, 1)).toLowerCase())); return 1; }; const str_upper = function(L) { // TODO: will fail on invalid UTF-8 - lua.lua_pushstring(L, lua.to_luastring(lobject.jsstring(lauxlib.luaL_checkstring(L, 1)).toUpperCase())); + lua.lua_pushstring(L, lua.to_luastring(lua.to_jsstring(lauxlib.luaL_checkstring(L, 1)).toUpperCase())); return 1; }; @@ -1319,7 +1319,7 @@ const add_value = function(ms, b, s, e, tr) { lua.lua_pop(L, 1); lua.lua_pushlstring(L, s, e - s); /* keep original text */ } else if (!lua.lua_isstring(L, -1)) - lauxlib.luaL_error(L, lua.to_luastring(`invalid replacement value (a ${lobject.jsstring(lauxlib.luaL_typename(L, -1))})`)); + lauxlib.luaL_error(L, lua.to_luastring(`invalid replacement value (a ${lua.to_jsstring(lauxlib.luaL_typename(L, -1))})`)); lauxlib.luaL_addvalue(b); /* add result to accumulator */ }; |