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

Handle toString() on a wrapped method #18

Closed
ruipin opened this issue Feb 9, 2021 · 1 comment
Closed

Handle toString() on a wrapped method #18

ruipin opened this issue Feb 9, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@ruipin
Copy link
Owner

ruipin commented Feb 9, 2021

Some modules, like Mess, attempt to patch existing methods by converting them to string first using toString(), applying a regex, and then replacing the original method.

Unfortunately, this is completely incompatible with any method wrapped by libWrapper, as toString() returns the source code of the libWrapper handler.

If possible, it might be a good idea to override the toString() method of the libWrapper handler function objects, and outright throw an exception, or if possible return the original method's toString() result.

@ruipin ruipin added the enhancement New feature or request label Feb 9, 2021
ruipin added a commit that referenced this issue Apr 11, 2021
- Implements all changes in #17
- Implements #18
- Adds caching of the handler functions, which should slightly increase
  performance.
@ruipin
Copy link
Owner Author

ruipin commented Apr 11, 2021

This is now done in v1.4.0.0, closing.

@ruipin ruipin closed this as completed Apr 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant