Skip to content

Commit 659c5c5

Browse files
airweenCopilot
andauthored
Update comment in Lua script
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 7b4ea18 commit 659c5c5

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

test/test-cases/data/match-getvars.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ function dump(o)
22
if type(o) == 'table' then
33
local s = '{ '
44
for k,v in pairs(o) do
5-
-- we create a local var because in Lua55
6-
-- variables k and v get an implicit 'const' modifier
7-
-- this works in previous Lua versions too
5+
-- In Lua 5.5, generic-for loop variables (k and v) are read-only,
6+
-- so we copy k into a local before formatting. This works in earlier
7+
-- Lua versions too.
88
local key_str = k
99
if type(key_str) ~= 'number' then
1010
key_str = '"'..key_str..'"'

0 commit comments

Comments
 (0)