aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2023-07-22 16:31:05 +0200
committerKim Alvefur <zash@zash.se>2023-07-22 16:31:05 +0200
commit0fa9d6be37147d8815e7877d1cb63842518c1416 (patch)
tree6ec4bcfd8e1ea388cd9609ef11922f2899be22c8 /util
parent683b90f87125b405b16bfe3e4654e024fc70345a (diff)
downloadprosody-0fa9d6be37147d8815e7877d1cb63842518c1416.tar.gz
prosody-0fa9d6be37147d8815e7877d1cb63842518c1416.zip
util.array: Fix new() library function
Backport of ffe4adbd2af9 since new was added in the 0.12 branch
Diffstat (limited to 'util')
-rw-r--r--util/array.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/util/array.lua b/util/array.lua
index 5461882a..39a97e7f 100644
--- a/util/array.lua
+++ b/util/array.lua
@@ -35,7 +35,9 @@ local function new_array(self, t, _s, _var)
return setmetatable(t or {}, array_mt);
end
-array.new = new_array;
+function array.new(t)
+ return setmetatable(t or {}, array_mt);
+end
function array_mt.__add(a1, a2)
local res = new_array();