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: Capitalize field names to match 262 style guide #766

Closed
wants to merge 40 commits into from

Conversation

ben-allen
Copy link
Contributor

fix #81

I've renamed most (not quite all) of the fields with names in [[camelCase]] to [[PascalCase]] in order to align with 262. As noted in the issue, the thing that makes this tricky is the use of dynamic accesses. The fixes here either removes dynamic accesses when possible to do so relatively elegantly -- for example, if format can only contain "short" or "long":

Set _blah_.[[<format>]] to *"blah"*.

is replaced with:

If _format_ is *"short"*, then
  Set _blah_.[[Short]] to *"blah"*.
Else,
  Set _blah_.[[Long]] to *"blah"*.

or for ones with relatively more possible options, tables are used, and when absolutely necessary, dynamic accesses are maintained but with the first character of the values of variables used for dynamic access replaced with its ASCII-uppercase equivalent.

The only all-lowercase field names I've preserved are ones like [[nu]] and [[co]] that we've inherited -- this seems stylistically nonoffensive to me, but it shouldn't be much trouble to change those fields to [[NumberingSystem]] and [[Collation]], etc., though some care will have to be taken to make sure those names aren't already in use.

The style on the whole in this PR is somewhat inconsistent due to me trying to more or less match the style of the surrounding spec in each section, but given the scope of the changes I figured it would be a good idea not to do anything further refactoring until more experienced eyes have been on this.

ben-allen and others added 30 commits March 14, 2023 16:53
This commit removes the `!` from two AO calls that return regular values
not abrupt completions.

notes for locale

complete notes for [[locale]]
…: this was a spec bug! it had been changed to HourCycle in the list of internal slots, but InitializeDateTimeFormat was still using [[hourCycle]]
…itivePattern]], [[ZeroPattern]], [[NegativePattern]], [[Unit]], [[Currency]], [[Decimal]], [[UnitDisplay]], [[Code]], [[Symbol]], [[Percent]], [[Narrow]], [[Short]], [[Long]]
…], [[PositivePattern]], [[ZeroPattern]], [[NegativePattern]], [[Unit]], [[Currency]], [[Decimal]], [[UnitDisplay]], [[Code]], [[Symbol]], [[Percent]], [[Narrow]], [[Short]], [[Long]]"

This reverts commit 2a7d3cb.
their PascalCase equivalents. Exceptions: fields with two-character
names like [[nu]] and [[co]], fields that are only accessed dynamically,
as in [[<locale>]].
@ben-allen ben-allen closed this Apr 8, 2023
@ben-allen ben-allen deleted the capitalization branch April 8, 2023 01:24
@ben-allen
Copy link
Contributor Author

see #770

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.

Editorial: Start all fields and slots with an uppercase code point
3 participants