-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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
Remove util.inherits usage internally? #24395
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. |
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
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 <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
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 <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
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. |
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: