From eae45eefb55410782559b4ace5350b2a99f63234 Mon Sep 17 00:00:00 2001
From: Nat Goodspeed <nat@lindenlab.com>
Date: Tue, 11 Jun 2024 13:39:13 -0400
Subject: mapargs() now accepts 'name1,name2,...' as argument names

in addition to a list {'name1', 'name2', ...}.
---
 indra/newview/scripts/lua/mapargs.lua | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/indra/newview/scripts/lua/mapargs.lua b/indra/newview/scripts/lua/mapargs.lua
index 78e691d8bc..45f5a9c556 100644
--- a/indra/newview/scripts/lua/mapargs.lua
+++ b/indra/newview/scripts/lua/mapargs.lua
@@ -21,6 +21,12 @@ local function mapargs(names, ...)
     -- array items it contains, if there are any holes. Track that by hand.
     -- We must be able to handle f(1, nil, 3) calls.
     local maxpos = 0
+
+    -- For convenience, allow passing 'names' as a string 'n0,n1,...'
+    if type(names) == 'string' then
+        names = string.split(names, ',')
+    end
+
     if not (args.n == 1 and type(args[1]) == 'table') then
         -- If caller passes more than one argument, or if the first argument
         -- is not a table, then it's classic positional function-call syntax:
-- 
cgit v1.2.3