summaryrefslogtreecommitdiff
path: root/src/lbaselib.js
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2017-04-26 23:42:18 +1000
committerdaurnimator <quae@daurnimator.com>2017-04-26 23:56:52 +1000
commit2c6ad8ae871ec8f511f1b983867fccf031bf38b3 (patch)
treeeacefbe085e0e551e4460046bd474395fcc74a32 /src/lbaselib.js
parenta70eeebe4aa5014e08b67da7ec07be903c3cf6a5 (diff)
downloadfengari-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/lbaselib.js')
-rw-r--r--src/lbaselib.js7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/lbaselib.js b/src/lbaselib.js
index fe329d6..5e3fff6 100644
--- a/src/lbaselib.js
+++ b/src/lbaselib.js
@@ -2,7 +2,6 @@
const lua = require('./lua.js');
const lauxlib = require('./lauxlib.js');
-const lobject = require('./lobject.js');
const luaB_print = function(L) {
let n = lua.lua_gettop(L); /* number of arguments */
@@ -22,8 +21,8 @@ const luaB_print = function(L) {
}
// Don't use console.log if Node
- if (process.stdout) process.stdout.write(lobject.jsstring(str) + "\n");
- else console.log(lobject.jsstring(str));
+ if (process.stdout) process.stdout.write(lua.to_jsstring(str) + "\n");
+ else console.log(lua.to_jsstring(str));
return 0;
};
@@ -162,7 +161,7 @@ const luaB_tonumber = function(L) {
lauxlib.luaL_checktype(L, 1, lua.LUA_TSTRING); /* no numbers as strings */
let s = lua.lua_tostring(L, 1);
lauxlib.luaL_argcheck(L, 2 <= base && base <= 36, 2, lua.to_luastring("base out of range", true));
- let n = parseInt(lobject.jsstring(s), base);
+ let n = parseInt(lua.to_jsstring(s), base);
if (!isNaN(n)) {
lua.lua_pushinteger(L, n);
return 1;