For this code:
> debug.sethook(function(...) print(...) end, "l")
>
local function foo()
>
end
>
foo()
>
A = 1
>
A = 2
>
A = 3
In lua5.4.2, the output is:
line 3
line 4
line 3
line 6
line 7
And
in lua5.3.6, the output is:
line 3
line 4
line 3
line 5
line 6
line 7