From 5cb00bbae4f1afb5cd476a637975dd9220898e15 Mon Sep 17 00:00:00 2001 From: daurnimator Date: Mon, 8 May 2017 15:22:17 +1000 Subject: src/lstring.js: Freeze strings to catch accidental modification --- src/lstring.js | 1 + 1 file changed, 1 insertion(+) (limited to 'src') 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; }; -- cgit v1.2.3-70-g09d2