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

Editorial: Improve case sensitivity and conversion #625

Merged
merged 8 commits into from
Mar 28, 2022

Conversation

gibson042
Copy link
Contributor

No description provided.

@sffc sffc requested review from romulocintra and removed request for sffc January 9, 2022 07:08
1. Else,
1. Assert: _targetCase_ is ~upper~.
1. Let _newCodePoints_ be a List whose elements are the result of an upper case transformation of _codePoints_ according to an implementation-derived algorithm using _locale_ or the Unicode Default Case Conversion algorithm.
1. Return ! CodePointsToString(_newCodePoints_).
Copy link
Contributor Author

@gibson042 gibson042 Jan 13, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This algorithm is technically omitting a possible error, but I'm not fully decided about how to remedy that. It occurs because ECMAScript String values are bounded to a maximum of 253 - 1 code units and some case transformations can increase length, meaning there are inputs for which the output is well-defined but not representable (e.g., "ß".repeat(2**53 - 1).toLocaleUpperCase("en")). I think the right approach is updating CodePointsToString (which is defined in ECMA-262) to throw an error when its input corresponds to out-of-bounds output and then updating this invocation to be explicitly fallible with ?, although I'm willing to wait on that because AFAICT every current implementation is incapable of dealing with strings near the limit.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@leobalter leobalter merged commit 6939b44 into tc39:master Mar 28, 2022
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.

None yet

2 participants