-
-
Notifications
You must be signed in to change notification settings - Fork 31.5k
Remove util.inherits usage internally? #24395
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Labels
good first issue
Issues that are suitable for first-time contributors.
util
Issues and PRs related to the built-in util module.
Comments
I'm +1 on writing a PR and running CitGM on it, then have it in nightlies go get some feedback. Otherwise we won't know. |
BridgeAR
added a commit
to BridgeAR/node
that referenced
this issue
Dec 2, 2018
This switches all `util.inherits()` calls to use `Object.setPrototypeOf()` instead. In fact, `util.inherits()` is mainly a small wrapper around exactly this function while adding the `_super` property on the object as well. Refs: nodejs#24395
addaleax
pushed a commit
that referenced
this issue
Dec 5, 2018
This switches all `util.inherits()` calls to use `Object.setPrototypeOf()` instead. In fact, `util.inherits()` is mainly a small wrapper around exactly this function while adding the `_super` property on the object as well. Refs: #24395 PR-URL: #24755 Refs: #24395 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
refack
pushed a commit
to refack/node
that referenced
this issue
Jan 14, 2019
This switches all `util.inherits()` calls to use `Object.setPrototypeOf()` instead. In fact, `util.inherits()` is mainly a small wrapper around exactly this function while adding the `_super` property on the object as well. Refs: nodejs#24395 PR-URL: nodejs#24755 Refs: nodejs#24395 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
This is still open, can probably be used as code-and-learn tasks |
If the issue is still open, I'd be interested in looking into this? |
@peanutenthusiast check out #26546 for an updated version of this issue. |
Closing as resolved. There is no usage internal usage left in core. |
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Labels
good first issue
Issues that are suitable for first-time contributors.
util
Issues and PRs related to the built-in util module.
Currently,
util.inherits
does this:node/lib/util.js
Lines 300 to 318 in e1aa730
Most of the code seems unnecessary for our internal use. Essentially we can just replace all the internal
util.inherits
usage withObject.setPrototypeOf(ctor.prototype, superCtor.prototype)
Unless someone is relying on that
ctor._super
property existing on our internal types..Any thoughts?
The text was updated successfully, but these errors were encountered: