Skip to content

fix passing self to metamethods, and add t=self arg syntax #13

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

Merged
merged 1 commit into from
May 20, 2024

Conversation

Numynum
Copy link
Contributor

@Numynum Numynum commented May 20, 2024

devtool will already automatically pass the parent to a function, if the function returns an error (though that's not helpful for functions that simply return nil, when no valid parent is passed)
but this was broken when using __index metamethods that are tables, and only worked for __index metamethods that are functions

in addition, I always felt like it'd be nice to be able to explicitly pass the self argument, so I also added t=self as an argument

comparing to DevTool.list, is needed to fix an error with GetParentTable returning DevTool.list, for functions that are added directly, e.g. through DevTool:AddData(someFunc)

@Numynum
Copy link
Contributor Author

Numynum commented May 20, 2024

image
since I made an example screenshot already anyway, might as well add it here 🙂

@brittyazel brittyazel merged commit 7379330 into brittyazel:main May 20, 2024
@brittyazel
Copy link
Owner

Great addition! Thanks for adding this. I look forward to using it :-)

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.

2 participants