Skip to content

Editorial: Make the Locale object abstract operation algorithms more explicit#1087

Open
gibson042 wants to merge 1 commit into
tc39:mainfrom
gibson042:gh-1083-followup
Open

Editorial: Make the Locale object abstract operation algorithms more explicit#1087
gibson042 wants to merge 1 commit into
tc39:mainfrom
gibson042:gh-1083-followup

Conversation

@gibson042

Copy link
Copy Markdown
Member

Ref #1083

@gibson042
gibson042 requested review from ptomato, ryzokuken and sffc July 7, 2026 19:00

@ptomato ptomato left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is an improvement IMO.

Comment thread spec/locale.html
1. Assert: The first subtag of _baseName_ can be matched by the <code>unicode_language_subtag</code> Unicode locale nonterminal.
1. Return the first subtag of _baseName_.
1. Let _subtags_ be StringSplitToList(_baseName_, *"-"*).
1. Assert: _subtags_[0] is matched by the <code>unicode_language_subtag</code> Unicode locale nonterminal.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Note, "subtags has at least one element" is implicit here and in similar language below, but I think that's OK.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

That's actually guaranteed by the final three steps of StringSplitToList.

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.

2 participants