-
Notifications
You must be signed in to change notification settings - Fork 29.9k
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
readline: use native codePointAt
#825
Conversation
@@ -1331,7 +1331,8 @@ function codePointAt(str, index) { | |||
} | |||
return code; | |||
} | |||
exports.codePointAt = codePointAt; | |||
exports.codePointAt = util.deprecate(codePointAt, | |||
'codePointAt() is deprecated. Use String.prototype.codePointAt'); |
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.
Instead of deprecating it, could we just alias it to Function.prototype.call.bind(String.prototype.codePointAt)
and note that it's there for legacy reasons in the docs?
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.
it is actually undocumented and is not supposed to be used anyway. Unfortunately we have a lot of private not underscored stuff
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.
If it's undocumented, isn't is subject to disappearing at any time? (I realize someone could be using it)
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.
FWIW, I agree with @vkurchatkin. I believe the reason it was exported was so it could be unit-tested in the test suite.
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 guess that would a bit irresponsible. People use repl to discover stuff. We need a roadmap to avoid these in the future
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.
Yes people use the repl and other reads the code to find and use undocumented apis. I've done it myself, but I do not expect that code to work between versions.
@chrisdickinson ping |
Semver: patch PR-URL: #825 Reviewed-By: Chris Dickinson <[email protected]>
LGTM. Merged in b41dbc2. |
R=have no idea