Skip to content

Conversation

smartinio
Copy link
Contributor

Description (What)

Fixes #63 by preventing conversion of functions when the first parameter is this

Justification (Why)

Some custom userland functions that are ultimately passed back into a library are sometimes required to be instance methods with this declared for correct argument types, regardless of whether this is needed by the function body. One such example is fastify's app.setErrorHandler(fn) (5.1.0)

How Can This Be Tested?

Tests were added

@JamieMason JamieMason changed the title fix: Prevent converting functions where first parameter is this fix: do not convert functions where first parameter is this Sep 28, 2025
@JamieMason JamieMason merged commit 704b0bc into JamieMason:main Sep 28, 2025
1 check passed
@JamieMason
Copy link
Owner

Released in 3.9.1, thanks a lot.

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.

Functions declaring this as first argument should not be converted

2 participants