summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2017-05-08 15:20:31 +1000
committerdaurnimator <quae@daurnimator.com>2017-05-08 15:31:52 +1000
commitb7719b5d3a5794e02a0a81d886a8dd906bda5b51 (patch)
treedfac52ff2826ddca76046d29eca9c9f434175d34 /src
parent2d6edc9572a815547c9202f93506c7d4f744d7fe (diff)
downloadfengari-b7719b5d3a5794e02a0a81d886a8dd906bda5b51.tar.gz
fengari-b7719b5d3a5794e02a0a81d886a8dd906bda5b51.tar.bz2
fengari-b7719b5d3a5794e02a0a81d886a8dd906bda5b51.zip
src/lstrlib.js: Array.prototype.reverse operates in place. Make a copy so that internal string isn't modified
Diffstat (limited to 'src')
-rw-r--r--src/lstrlib.js2
1 files changed, 1 insertions, 1 deletions
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;
};