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

Revert "performance patch" #61

Closed
wants to merge 1 commit into from
Closed

Conversation

Uzlopak
Copy link
Contributor

@Uzlopak Uzlopak commented Feb 19, 2022

As discussed in nodejs/node#42042 (comment) it seems that the performance improvement has some implications and should be reverted.

@mcollina
Copy link
Member

For this specific module I think we are ok. We are not hitting any of the other constraints around inheritance here.

@xtx1130
Copy link
Contributor

xtx1130 commented Feb 21, 2022

I'm +1 with mcollina. This package is just a Error standard implementation. See : Error() constructor. Use new to create an error or just use Error() is supported, and both initializations will trigger new.target.

@mcollina
Copy link
Member

I would arguably say that's better to move the error to class and be done with it.

@Uzlopak
Copy link
Contributor Author

Uzlopak commented Feb 21, 2022

just for clarification:

This PR is not a critique on the implementation. It is good that we can discuss this issue and have an active decision to apply or reject this PR.

@xtx1130
Copy link
Contributor

xtx1130 commented Feb 21, 2022

@mcollina It can't move to class , because use class can't implement Error() method. class just can call with new.

@mcollina
Copy link
Member

@mcollina It can't move to class , because use class can't implement Error() method. class just can call with new.

I'll just bump the major version and remove that feature.

@xtx1130
Copy link
Contributor

xtx1130 commented Feb 21, 2022

If you ensure to drop the support of Error(). I can send a PR for fastify-error recently and will move the error to class

@mcollina
Copy link
Member

Let's go with that, it seems the right thing to do given the subject and perf boost.

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

3 participants