-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
util: use missing validators #38893
util: use missing validators #38893
Conversation
The `inherits()` method in the `util` lib module is not using validators which others do use.
Removed the `ERR_INVALID_ARG_TYPE` constructor which was only used in the `inherits()` method which is replaced now.
The value must be a function to test the type of the prototype since validators first check if the value is a function.
The message expects to fail with the value `undefined`, not `null`.
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 is a breaking change, because it makes the requirements on ctor
and superCtor
a bit stricter.
Since the docs already mention that one should use ES6 class extends
instead, can we maybe just mark util.inherits
with the new official "legacy" status instead?
I'm +1 on that, I would like to hear other collaborators/members opinions and see they agree as well 😄 |
Just gonna open another PR referencing this to change the status to legacy, closing. |
PR-URL: nodejs#38896 Refs: nodejs#38893 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Zijian Liu <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Darshan Sen <[email protected]> Reviewed-By: Zeyu Yang <[email protected]>
PR-URL: #38896 Refs: #38893 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Zijian Liu <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Darshan Sen <[email protected]> Reviewed-By: Zeyu Yang <[email protected]>
PR-URL: #38896 Refs: #38893 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Zijian Liu <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Darshan Sen <[email protected]> Reviewed-By: Zeyu Yang <[email protected]>
PR-URL: #38896 Refs: #38893 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Zijian Liu <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Darshan Sen <[email protected]> Reviewed-By: Zeyu Yang <[email protected]>
PR-URL: #38896 Refs: #38893 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Zijian Liu <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Darshan Sen <[email protected]> Reviewed-By: Zeyu Yang <[email protected]>
PR-URL: nodejs#38896 Refs: nodejs#38893 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Zijian Liu <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Darshan Sen <[email protected]> Reviewed-By: Zeyu Yang <[email protected]>
The
inherits()
method in theutil
lib module is not using validators which others do use.