From b7719b5d3a5794e02a0a81d886a8dd906bda5b51 Mon Sep 17 00:00:00 2001 From: daurnimator Date: Mon, 8 May 2017 15:20:31 +1000 Subject: src/lstrlib.js: Array.prototype.reverse operates in place. Make a copy so that internal string isn't modified --- src/lstrlib.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lstrlib.js b/src/lstrlib.js index 37a3287..f5b9f34 100644 --- a/src/lstrlib.js +++ b/src/lstrlib.js @@ -631,7 +631,7 @@ const str_pack = function(L) { }; const str_reverse = function(L) { - lua.lua_pushstring(L, lauxlib.luaL_checkstring(L, 1).reverse()); + lua.lua_pushstring(L, lauxlib.luaL_checkstring(L, 1).slice(0).reverse()); return 1; }; -- cgit v1.2.3-70-g09d2