-
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
net: remove usage of require('util') #26807
Conversation
Use `require('internal/util/inspect').inspect` and `require('internal/util/debuglog').debuglog` instead of `require('util').debuglog` and `require('util').inspect`. Refs: nodejs#26546
|
Use `require('internal/util/inspect').inspect` and `require('internal/util/debuglog').debuglog` instead of `require('util').debuglog` and `require('util').inspect`. PR-URL: nodejs#26807 Refs: nodejs#26546 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
This broke master (likely due to a different change that landed in the meanwhile that conflicts with this one) and I had to pull it out again. @dnlup would you be so kind and rebase this and to take another look? Thanks! |
This commit is still in master and the test is still broken. I'll open a fast-track revert unless somebody else is already doing that. And if we get a fix in before we revert, cool. And if not, we can re-land later. |
@BridgeAR Yes, no problem |
@BridgeAR Rebasing I get this error in
which I think it is caused by using
instead of
which sets the https://github.com/nodejs/node/blob/master/lib/util.js#L145 |
@BridgeAR I would change this too if you're ok with it const internalUtil = require('internal/util'); to const { deprecate } = require('internal/util'); since deprecate is the only function used in this module. |
@dnlup sure, go ahead. |
@BridgeAR So I rebased master again, modified the test and it looks good. Only thing is that I should |
@dnlup thanks. Normally it would absolutely be fine to force push but I would rather have a new PR for this since I messed up removing the original commit (I pushed to my fork instead of to upstream) and it was instead reverted. So this PR is still referenced by the commit and it should actually be closed and ideally another PR would be opened. |
Closing in favour of #26920 |
Use `require('internal/util/inspect').inspect` and `require('internal/util/debuglog').debuglog` instead of `require('util').debuglog` and `require('util').inspect`. PR-URL: nodejs#26807 Refs: nodejs#26546 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Use
require('internal/util/inspect').inspect
andrequire('internal/util/debuglog').debuglog
instead ofrequire('util').debuglog
andrequire('util').inspect
.Refs: #26546
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes