Skip to content

Commit

Permalink
Editorial: Minor cleanup (#91)
Browse files Browse the repository at this point in the history
  • Loading branch information
gibson042 authored Dec 13, 2019
1 parent a4a51de commit b88e3c9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ All of these boundary types are actually locale-dependent, and some allow comple
### What exactly does the index refer to?

An index *n* refers to the code unit index within a string that is potentially the start of a segment.
For example, when iterating over the string "Hello, world💙" by words in English,segments will start at indexes 0, 5, 6, 7, 12, and 14 (i.e., the string gets segmented like `┃Hello┃,┃ ┃world┃💙┃`, with the final segment consisting of a surrogate pair of two code units encoding a single code point).
For example, when iterating over the string "Hello, world💙" by words in English,segments will start at indexes 0, 5, 6, 7, and 12 (i.e., the string gets segmented like `┃Hello┃,┃ ┃world┃💙┃`, with the final segment consisting of a surrogate pair of two code units encoding a single code point).
The definition of these boundary indexes does not depend on whether forwards or backwards iteration is used.

### What happens when segmenting an empty string?
Expand All @@ -205,7 +205,7 @@ We essentially synthesize two positions at which there is no segment (not just f

### What happens when I try to use random access with non-Number values?

Someone's in QA. 😉
_Someone's_ in QA. 😉
The random access methods treat `undefined` starting index the same as unspecified, and will start from the current index.
All other inputs are processed into integer Numbers—`null` becomes 0, Booleans become 0 or 1, Strings are parsed as string numeric literals, Objects are cast to primitives, and Symbols, BigInts, and `NaN` fail. Fractional components are truncated, but infinite Numbers are accepted as-is.

Expand Down
1 change: 0 additions & 1 deletion spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,6 @@ <h1>AdvanceSegmentIterator ( _iterator_, _lastIndex_, _direction_ )</h1>
<emu-note>Boundary determination is implementation-dependent, but general default algorithms are specified in Unicode Standard Annex 29 (available at <a href="https://www.unicode.org/reports/tr29/">https://www.unicode.org/reports/tr29/</a>). It is recommended that implementations use locale-sensitive tailorings such as those provided by the Common Locale Data Repository (available at <a href="http://cldr.unicode.org">http://cldr.unicode.org</a>).</emu-note>
<emu-alg>
1. Assert: Type(_iterator_) is Object and _iterator_ has an [[IteratingSegmenter]] internal slot.
1. Perform ? RequireInternalSlot(_iterator_, [[IteratingSegmenter]]).
1. Let _segmenter_ be _iterator_.[[IteratingSegmenter]].
1. Let _locale_ be _segmenter_.[[Locale]].
1. Let _granularity_ be _segmenter_.[[SegmenterGranularity]].
Expand Down

0 comments on commit b88e3c9

Please sign in to comment.