diff options
author | daurnimator <quae@daurnimator.com> | 2017-05-08 15:20:31 +1000 |
---|---|---|
committer | daurnimator <quae@daurnimator.com> | 2017-05-08 15:31:52 +1000 |
commit | b7719b5d3a5794e02a0a81d886a8dd906bda5b51 (patch) | |
tree | dfac52ff2826ddca76046d29eca9c9f434175d34 /src/lstrlib.js | |
parent | 2d6edc9572a815547c9202f93506c7d4f744d7fe (diff) | |
download | fengari-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/lstrlib.js')
-rw-r--r-- | src/lstrlib.js | 2 |
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; }; |