-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
doc: replace util.inherits() with es6 classes extends #6512
Comments
|
Yep, sure :-(. One upside would be that |
This... always ;-)
|
util.inherits breaks the prototype chain. A fix does not seem useful, since ES6 extends provides language level support for the same functionality. This commit starts fasing out mentions of the method. Fixes: #6512 Fixes: #4179 PR-URL: #6514 Reviewed-By: James Snell <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
util.inherits breaks the prototype chain. A fix does not seem useful, since ES6 extends provides language level support for the same functionality. This commit starts fasing out mentions of the method. Fixes: #6512 Fixes: #4179 PR-URL: #6514 Reviewed-By: James Snell <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
util.inherits() is probably long unloved. With full class support it would be worth thinking of slowly deprecating it as weakly suggested in #4179 by @bnoordhuis .
Since this would strongly promote the
class
keyword for the JS world we would need to think about whether we want to do this and in which form. Personally I am not a big fan of it in general - especially since es6 proposed style would have methods on a non 0 indentation level. So we could think about the following:cc @nodejs/documentation @jasnell
The text was updated successfully, but these errors were encountered: