From 90649345e011cdb998efe216f5e94a38d81eb4d2 Mon Sep 17 00:00:00 2001 From: daurnimator Date: Sun, 7 Jan 2018 01:43:59 +1100 Subject: Avoid String.fromCodePoint (IE compat) --- src/lutf8lib.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/lutf8lib.js') 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); }; /* -- cgit v1.2.3-54-g00ecf