Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

vkurchatkin
Copy link
Contributor

R=have no idea

@@ -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');
Copy link
Contributor

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?

Copy link
Contributor Author

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

Copy link
Contributor

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)

Copy link
Member

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.

Copy link
Contributor Author

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

Copy link
Contributor

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.

@vkurchatkin
Copy link
Contributor Author

@chrisdickinson ping

vkurchatkin added a commit that referenced this pull request Feb 23, 2015
Semver: patch
PR-URL: #825
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
@chrisdickinson
Copy link
Contributor

LGTM. Merged in b41dbc2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants