If a breakpoint is placed within a nested scope (where the scope itself has not captured an upvalue) and the breakpoint attempts to access said upvalue, it will retrieve nil.
For example, in this code, if a logpoint is placed on line 4 within foo and attempts to access myUpvalue, it will log nil:
local myUpvalue = 10
local function foo()
print("foo happened")
end
foo()
Output:
However, if
foo captures myUpvalue by giving it to print, then the logpoint works as expected:
local myUpvalue = 10
local function foo()
print("foo happened", myUpvalue)
end
foo()
Output:
![]()
This behavior makes debugging with breakpoints annoying, as I need to manually edit code to capture upvalues if I want to observe them for conditional or logging purposes.
Expected behavior
I expect breakpoints to capture and read upvalues.
