summaryrefslogtreecommitdiff
path: root/src/lobject.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/lobject.js
parent49d690ac913f025178606c8e2f64640060352ce6 (diff)
downloadfengari-90649345e011cdb998efe216f5e94a38d81eb4d2.tar.gz
fengari-90649345e011cdb998efe216f5e94a38d81eb4d2.tar.bz2
fengari-90649345e011cdb998efe216f5e94a38d81eb4d2.zip
Avoid String.fromCodePoint (IE compat)
Diffstat (limited to 'src/lobject.js')
-rw-r--r--src/lobject.js7
1 files changed, 5 insertions, 2 deletions
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;