From 0fa9d6be37147d8815e7877d1cb63842518c1416 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sat, 22 Jul 2023 16:31:05 +0200 Subject: util.array: Fix new() library function Backport of ffe4adbd2af9 since new was added in the 0.12 branch --- util/array.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'util') 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(); -- cgit v1.2.3