Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allowing inspection of functions #72

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

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.

None yet

1 participant