-
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
repl: deprecate REPLServer.prototype.memory #16242
Conversation
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.
Do we have any concept of ecosystem usage? Other than that, LGTM.
lib/repl.js
Outdated
REPLServer.prototype.memory = function memory(cmd) { | ||
var self = this; | ||
REPLServer.prototype.memory = util.deprecate( | ||
function(cmd) { _memory(this, cmd); }, |
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.
Nit: I'd use _memory
directly to remove yet another wrapper.
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.
@lpinca If I deprecate like so
REPLServer.prototype.memory = util.deprecate(
_memory,
'REPLServer.memory() is deprecated',
'DEP00XX');
then I will need to set self = this
in _memory
. E.g.
function _memory(cmd) {
self = this;
self.lines = self.lines || [];
self.lines.level = self.lines.level || [];
// ... etc
}
With the current implementation, all internal calls go directly to `_memory()`, bypassing the wrapper altogether. Only those calls to `REPLServer.prototype.memory()` will hit it, and the idea is for this to go away anyway.
**EDIT** Never mind all that. I'll take care of the nit.
const warn = 'REPLServer.memory() is deprecated'; | ||
|
||
common.expectWarning('DeprecationWarning', warn); | ||
assert.ok(server.memory() === undefined); |
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.
Nit: assert.strictEqual()
?
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.
I will address this when landing.
This method is only useful for the internal mechanics of the REPLServer and does not need to be exposed in user space. It was previously not documented, so I believe a Runtime deprecation makes sense.
@cjihrig there is this from @ChALkeR from over a year ago. #7619 (comment) So it seems like ecosystem usage is small, but it's hard to know for sure. It's hard for me to understand exactly what users in the ecosystem would be using this method for. It really is an internal implementation detail. |
Running a second CI since lots of flakey tests failed on the first: https://ci.nodejs.org/job/node-test-pull-request/10812/ |
Still several unrelated failed tests in CI. I'm not going to detail them here because it's quite tedious. But I wonder if CI flakiness is this getting worse. I see this a lot lately. Unless anyone objects, I'm going to go ahead and land this tomorrow in spite of CI failures. |
This method is only useful for the internal mechanics of the REPLServer and does not need to be exposed in user space. It was previously not documented, so I believe a Runtime deprecation makes sense. PR-URL: #16242 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Jeremiah Senkpiel <[email protected]>
Landed in: 7a29f44 |
This method is only useful for the internal mechanics of the REPLServer and does not need to be exposed in user space. It was previously not documented, so I believe a Runtime deprecation makes sense. PR-URL: nodejs/node#16242 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Jeremiah Senkpiel <[email protected]>
This method is only useful for the internal mechanics of the REPLServer and does not need to be exposed in user space. It was previously not documented, so I believe a Runtime deprecation makes sense. PR-URL: nodejs/node#16242 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Jeremiah Senkpiel <[email protected]>
This method is only useful for the internal mechanics of the REPLServer
and does not need to be exposed in user space. It was previously not
documented, so I believe a Runtime deprecation makes sense.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
repl, doc