summaryrefslogtreecommitdiff
path: root/src/lutf8lib.js
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2018-01-07 01:43:59 +1100
committerdaurnimator <quae@daurnimator.com>2018-01-07 01:43:59 +1100
commit90649345e011cdb998efe216f5e94a38d81eb4d2 (patch)
treec9eeb1a98892fa424c16e5b8ae930262228aa740 /src/lutf8lib.js
parent49d690ac913f025178606c8e2f64640060352ce6 (diff)
downloadfengari-90649345e011cdb998efe216f5e94a38d81eb4d2.tar.gz
fengari-90649345e011cdb998efe216f5e94a38d81eb4d2.tar.bz2
fengari-90649345e011cdb998efe216f5e94a38d81eb4d2.zip
Avoid String.fromCodePoint (IE compat)
Diffstat (limited to 'src/lutf8lib.js')
-rw-r--r--src/lutf8lib.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lutf8lib.js b/src/lutf8lib.js
index 722d9f1..58533cf 100644
--- a/src/lutf8lib.js
+++ b/src/lutf8lib.js
@@ -76,10 +76,11 @@ const utflen = function(L) {
return 1;
};
+const p_U = lua.to_luastring("%U");
const pushutfchar = function(L, arg) {
let code = lauxlib.luaL_checkinteger(L, arg);
lauxlib.luaL_argcheck(L, 0 <= code && code <= MAXUNICODE, arg, lua.to_luastring("value out of range", true));
- lua.lua_pushstring(L, lua.to_luastring(String.fromCodePoint(code)));
+ lua.lua_pushfstring(L, p_U, code);
};
/*