summaryrefslogtreecommitdiff
path: root/src/llex.js
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2017-12-11 15:48:32 +1100
committerdaurnimator <quae@daurnimator.com>2017-12-11 16:00:06 +1100
commitd99cc3be545aa7f827030ec0ac502c00f530f8bf (patch)
treec30ac6bcffb88a58dce452f9ac5dda36245ff8c9 /src/llex.js
parent5b564fb8e230f98b672aea534c16d7d99ffe1944 (diff)
downloadfengari-d99cc3be545aa7f827030ec0ac502c00f530f8bf.tar.gz
fengari-d99cc3be545aa7f827030ec0ac502c00f530f8bf.tar.bz2
fengari-d99cc3be545aa7f827030ec0ac502c00f530f8bf.zip
src/{llex,lobject}.js: Fix luaO_utf8esc/luaO_utf8desc confusion
Diffstat (limited to 'src/llex.js')
-rw-r--r--src/llex.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/llex.js b/src/llex.js
index 9e27d02..19f2c05 100644
--- a/src/llex.js
+++ b/src/llex.js
@@ -369,9 +369,9 @@ const readutf8desc = function(ls) {
};
const utf8esc = function(ls) {
- let u = lobject.luaO_utf8esc(readutf8desc(ls));
- let buff = u.buff;
- for (let n = u.n; n > 0; n--) /* add 'buff' to string */
+ let buff = new Array(lobject.UTF8BUFFSZ);
+ let n = lobject.luaO_utf8esc(buff, readutf8desc(ls));
+ for (; n > 0; n--) /* add 'buff' to string */
save(ls, buff[lobject.UTF8BUFFSZ - n]);
};