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/lobject.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/lobject.js') diff --git a/src/lobject.js b/src/lobject.js index bd10be8..b5d4a96 100644 --- a/src/lobject.js +++ b/src/lobject.js @@ -607,9 +607,12 @@ const luaO_pushvfstring = function(L, fmt, argp) { } break; } - case char['U']: - pushstr(L, defs.to_luastring(String.fromCodePoint(argp[a++]))); + case char['U']: { + let buff = new Uint8Array(UTF8BUFFSZ); + let l = luaO_utf8esc(buff, argp[a++]); + pushstr(L, buff.subarray(UTF8BUFFSZ - l)); break; + } case char['%']: pushstr(L, defs.to_luastring("%", true)); break; -- cgit v1.2.3-54-g00ecf