diff options
author | Kim Alvefur <zash@zash.se> | 2018-10-12 00:51:52 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2018-10-12 00:51:52 +0200 |
commit | 15ba5f41b17393bd610a547b3c62312986b9efc5 (patch) | |
tree | e9d22860f36a8a6804efede7a6f84cc2656a3e4e | |
parent | 1789a7adf85b8c3467941d5962630745fbdac723 (diff) | |
download | prosody-15ba5f41b17393bd610a547b3c62312986b9efc5.tar.gz prosody-15ba5f41b17393bd610a547b3c62312986b9efc5.zip |
util.array: Add freeze metamethod
-rw-r--r-- | util/array.lua | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/util/array.lua b/util/array.lua index 1a8ffec7..4eb10f22 100644 --- a/util/array.lua +++ b/util/array.lua @@ -21,6 +21,8 @@ local array_base = {}; local array_methods = {}; local array_mt = { __index = array_methods, __name = "array", __tostring = function (self) return "{"..self:concat(", ").."}"; end }; +function array_mt:__freeze() return self; end + local function new_array(self, t, _s, _var) if type(t) == "function" then -- Assume iterator t = self.collect(t, _s, _var); |