We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7b4ea18 commit 659c5c5Copy full SHA for 659c5c5
1 file changed
test/test-cases/data/match-getvars.lua
@@ -2,9 +2,9 @@ function dump(o)
2
if type(o) == 'table' then
3
local s = '{ '
4
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
+ -- In Lua 5.5, generic-for loop variables (k and v) are read-only,
+ -- so we copy k into a local before formatting. This works in earlier
+ -- Lua versions too.
8
local key_str = k
9
if type(key_str) ~= 'number' then
10
key_str = '"'..key_str..'"'
0 commit comments