summaryrefslogtreecommitdiff
path: root/src/lstrlib.js
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2018-01-07 03:28:43 +1100
committerdaurnimator <quae@daurnimator.com>2018-01-07 03:35:03 +1100
commitef0784b2982e65af05982d8e1e18ef1d45ea96ad (patch)
tree0cc5a7aff5c54c7dae8f2fa84dc4f32a131e47bf /src/lstrlib.js
parenta63de72aa0bf0b1b3bd91ed0c23c4d03bcbf4cd5 (diff)
downloadfengari-ef0784b2982e65af05982d8e1e18ef1d45ea96ad.tar.gz
fengari-ef0784b2982e65af05982d8e1e18ef1d45ea96ad.tar.bz2
fengari-ef0784b2982e65af05982d8e1e18ef1d45ea96ad.zip
Avoid Uint8Array.slice (IE compat)
Diffstat (limited to 'src/lstrlib.js')
-rw-r--r--src/lstrlib.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lstrlib.js b/src/lstrlib.js
index 6cb8df9..6986411 100644
--- a/src/lstrlib.js
+++ b/src/lstrlib.js
@@ -88,11 +88,11 @@ const L_NBFD = 1;
const num2straux = function(x) {
/* if 'inf' or 'NaN', format it like '%g' */
if (Object.is(x, Infinity))
- return lua.to_luastring('inf', true).slice(0);
+ return lua.to_luastring('inf');
else if (Object.is(x, -Infinity))
- return lua.to_luastring('-inf', true).slice(0);
+ return lua.to_luastring('-inf');
else if (Number.isNaN(x))
- return lua.to_luastring('nan', true).slice(0);
+ return lua.to_luastring('nan');
else if (x === 0) { /* can be -0... */
/* create "0" or "-0" followed by exponent */
let zero = sprintf(luaconf.LUA_NUMBER_FMT + "x0p+0", x);