-
Notifications
You must be signed in to change notification settings - Fork 30k
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
process: replace validator #41660
process: replace validator #41660
Conversation
7dd6405
to
563e149
Compare
Replace the `validateFunction()` validator with the `validateCallback()` validator to validate callbacks and keep consistency.
563e149
to
728965f
Compare
Changing an error code is usually semver-major but I could the case for treating this as a bug fix. @nodejs/tsc Thoughts? |
Personally, I'd like to see us reduce the specificity of error codes in general. I think |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has the potential to break a lot of users' tests when they use queueMicrotask
because of the error code change doesn't it?
Intuitively, this sort of breakage isn't worth it in a stable API - it's not a lot of breakage but it's not like we feel strongly the error should change.
(I also agree with @Trott the fact we have a lot of error codes does not necessarily help our users)
+1 to label this as semver-major, changing an error code is a potential breaking change. +1 to get rid of validateCallback(class{}); // doesn't throw |
Bug fixes can be server-major too, so I'm adding the label back. |
I would be more than happy to remove the
validateCallback(class{}); // doesn't throw That's the exact same case with the We could entirely remove the |
Yes, that would be a semver-major change (but one that is worth making in my opinion, especially if we can remove a few other codes in the same semver-major bump). |
Replace the
validateFunction()
validator with thevalidateCallback()
validator to validate callbacks and keepconsistency.