tc39 / proposal-intl-segmenter

Unicode text segmentation for ECMAScript
https://tc39.github.io/proposal-intl-segmenter/
146 stars 16 forks source link

EDITORIAL: Assert: Cond1 and Cond2 should be changed to two Asserts #105

Closed FrankYFTang closed 4 years ago

FrankYFTang commented 4 years ago

In https://tc39.es/proposal-intl-segmenter/#sec-createsegmentdataobject We currently have

2. Assert: startIndex ≥ 0 and startIndex < len.
3. Assert: endIndex > startIndex and endIndex ≤ len.

We should simplified them to 4 Asserts instead

2. Assert: startIndex ≥ 0.
3. Assert: startIndex < len.
4. Assert: endIndex > startIndex.
5. Assert: endIndex ≤ len.
FrankYFTang commented 4 years ago

@gibson042

FrankYFTang commented 4 years ago

Also, the only reason we have

1. Let len be the length of string.

is for the assert. Should we just skip the asserts here.