summaryrefslogtreecommitdiff
path: root/src/lstring.js
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2017-05-08 15:22:17 +1000
committerdaurnimator <quae@daurnimator.com>2017-05-08 15:32:22 +1000
commit5cb00bbae4f1afb5cd476a637975dd9220898e15 (patch)
treee1559df7238aee4c3f8996efe0315394b6ccf9f6 /src/lstring.js
parenta4cbe2f7cabe1dd4bb91c8e3909c53c0bd3dc44d (diff)
downloadfengari-5cb00bbae4f1afb5cd476a637975dd9220898e15.tar.gz
fengari-5cb00bbae4f1afb5cd476a637975dd9220898e15.tar.bz2
fengari-5cb00bbae4f1afb5cd476a637975dd9220898e15.zip
src/lstring.js: Freeze strings to catch accidental modification
Diffstat (limited to 'src/lstring.js')
-rw-r--r--src/lstring.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/lstring.js b/src/lstring.js
index 34f988e..af434c6 100644
--- a/src/lstring.js
+++ b/src/lstring.js
@@ -13,6 +13,7 @@ const luaS_hash = function(str) {
/* variant that takes ownership of array */
const luaS_bless = function(L, str) {
+ Object.freeze(str);
return str;
};