Skip to content

Allowing inspection of functions#72

Open
sewbacca wants to merge 2 commits intotomblind:masterfrom
sewbacca:master
Open

Allowing inspection of functions#72
sewbacca wants to merge 2 commits intotomblind:masterfrom
sewbacca:master

Conversation

@sewbacca
Copy link

@sewbacca sewbacca commented Oct 5, 2022

This pull request allows you to inspect variables inside a closure, as I mentioned in #70.
I am using debug metatables for functions to allow further inspection. Currently it is looking up all upvalues, once it is indexed by the property name. It is usefull when having a lot of closures flying arround, e.g.

local function wrap(name)
    return function() return name end
end

local a = wrap "a"
local b = wrap "b"

local function callAndPrint(f)
    return print(f()) -- Which f?
end

callAndPrint(a)
callAndPrint(b)

Since, the change itself is small, but the impact could be big, I would recommend reviewing the code before merging. I am not too familiar with this project.

Ismoh added a commit to Ismoh/local-lua-debugger-vscode that referenced this pull request Oct 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments