Skip to content

fix: do not convert functions where first parameter is this#64

Merged
JamieMason merged 3 commits into
JamieMason:mainfrom
smartinio-wolt:main
Sep 28, 2025
Merged

fix: do not convert functions where first parameter is this#64
JamieMason merged 3 commits into
JamieMason:mainfrom
smartinio-wolt:main

Conversation

@smartinio
Copy link
Copy Markdown
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
Copy Markdown
Owner

Released in 3.9.1, thanks a lot.

Copy link
Copy Markdown

@alenagrinchenko35-stack alenagrinchenko35-stack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

3 participants