CreateSegmentDataObject ( segmenter, string, startIndex, endIndex )
11. If granularity is "word", then
a. Let isWordLike be a Boolean value indicating whether the segment in string is "word-like" according to locale segmenter.[[Locale]].
12. Else
a. Let isWordLike be undefined.
13. Perform ! CreateDataPropertyOrThrow(result, "isWordLike", isWordLike).
14. Return result.
But why do we need to create an isWordLike w/ the value undefined when the granularity is NOT "word"?
Why don't we just not create it instead?
I suggest we change it to
CreateSegmentDataObject ( segmenter, string, startIndex, endIndex )
11. If granularity is "word", then
a. Let isWordLike be a Boolean value indicating whether the segment in string is "word-like" according to locale segmenter.[[Locale]].
b. Perform ! CreateDataPropertyOrThrow(result, "isWordLike", isWordLike).
12. Return result.
In https://tc39.es/proposal-intl-segmenter/#sec-createsegmentdataobject
But why do we need to create an isWordLike w/ the value undefined when the granularity is NOT "word"? Why don't we just not create it instead?
I suggest we change it to
@tc39/ecma-fellows @littledan @gibson042 @zbraniecki @mathiasbynens