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/llex.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/llex.js')
-rw-r--r-- | src/llex.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/llex.js b/src/llex.js index c19452c..da15b2f 100644 --- a/src/llex.js +++ b/src/llex.js @@ -159,7 +159,7 @@ const save = function(ls, c) { const luaX_token2str = function(ls, token) { if (typeof token === "string" || token < FIRST_RESERVED) { /* single-byte symbols? */ - return defs.to_luastring(`'${typeof token === "string" ? token : lobject.jsstring([token])}'`); + return defs.to_luastring(`'${typeof token === "string" ? token : defs.to_jsstring([token])}'`); } else { let s = luaX_tokens[token - FIRST_RESERVED]; if (token < R.TK_EOS) /* fixed format (symbols and reserved words)? */ @@ -283,7 +283,7 @@ const txtToken = function(ls, token) { case R.TK_NAME: case R.TK_STRING: case R.TK_FLT: case R.TK_INT: save(ls, 0); - return defs.to_luastring(`'${lobject.jsstring(ls.buff.buffer)}'`); + return defs.to_luastring(`'${defs.to_jsstring(ls.buff.buffer)}'`); default: return luaX_token2str(ls, token); } @@ -292,7 +292,7 @@ const txtToken = function(ls, token) { const lexerror = function(ls, msg, token) { msg = ldebug.luaG_addinfo(ls.L, msg, ls.source, ls.linenumber); if (token) - lapi.lua_pushstring(ls.L, defs.to_luastring(`${msg instanceof TValue ? msg.jsstring() : msg} near ${lobject.jsstring(txtToken(ls, token))}`)); + lapi.lua_pushstring(ls.L, defs.to_luastring(`${msg instanceof TValue ? msg.jsstring() : msg} near ${defs.to_jsstring(txtToken(ls, token))}`)); ldo.luaD_throw(ls.L, TS.LUA_ERRSYNTAX); }; |