From d47c82caf02bd21d05700c48a52d8be69db9ad7d Mon Sep 17 00:00:00 2001 From: daurnimator Date: Fri, 9 Jun 2017 15:23:31 +1000 Subject: src/llex.js: Use luaO_pushfstring instead of javascript string interpolation --- src/llex.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/llex.js b/src/llex.js index 8abd27b..4c2be8c 100644 --- a/src/llex.js +++ b/src/llex.js @@ -120,7 +120,7 @@ const luaX_token2str = function(ls, token) { } else { let s = luaX_tokens[token - FIRST_RESERVED]; if (token < R.TK_EOS) /* fixed format (symbols and reserved words)? */ - return defs.to_luastring(`'${s}'`); + return lobject.luaO_pushfstring(ls.L, defs.to_luastring("'%s'", true), defs.to_luastring(s)); else /* names, strings, and numerals */ return defs.to_luastring(s); } @@ -260,7 +260,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(`'${defs.to_jsstring(ls.buff.buffer)}'`); + return lobject.luaO_pushfstring(ls.L, defs.to_luastring("'%s'", true), ls.buff.buffer); default: return luaX_token2str(ls, token); } -- cgit v1.2.3-70-g09d2