Bug 213638 - [JSC] Add Intl.Segmenter
Summary: [JSC] Add Intl.Segmenter
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Yusuke Suzuki
URL:
Keywords: InRadar
Depends on:
Blocks: 213425
  Show dependency treegraph
 
Reported: 2020-06-25 21:18 PDT by Yusuke Suzuki
Modified: 2020-08-22 12:23 PDT (History)
15 users (show)

See Also:


Attachments
Patch (122.34 KB, patch)
2020-07-21 19:51 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (122.70 KB, patch)
2020-07-21 19:57 PDT, Yusuke Suzuki
ross.kirsling: review+
Details | Formatted Diff | Diff
Rebaseline, test262 (113.15 KB, patch)
2020-07-25 22:44 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Rebaseline + update (110.70 KB, patch)
2020-07-25 22:52 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (109.74 KB, patch)
2020-07-31 23:21 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yusuke Suzuki 2020-06-25 21:18:05 PDT
...
Comment 1 Yusuke Suzuki 2020-07-21 19:51:01 PDT
Created attachment 404895 [details]
Patch
Comment 2 Yusuke Suzuki 2020-07-21 19:57:50 PDT
Created attachment 404896 [details]
Patch
Comment 3 Ross Kirsling 2020-07-22 12:00:51 PDT
Comment on attachment 404896 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=404896&action=review

r=me. I'm sad that we don't have test262 tests yet, but it's behind a flag, so we can keep tweaking things.

> Source/JavaScriptCore/runtime/IntlSegmenter.cpp:180
> +        result->putDirect(vm, vm.propertyNames->isWordLike, jsBoolean(!(ruleStatus >= UBRK_WORD_NONE && ruleStatus <= UBRK_WORD_NONE_LIMIT)));

Seems like DeMorgan's rule wouldn't make this less clear?
  jsBoolean(ruleStatus < UBRK_WORD_NONE || ruleStatus > UBRK_WORD_NONE_LIMIT)
Comment 4 Yusuke Suzuki 2020-07-22 13:14:00 PDT
Comment on attachment 404896 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=404896&action=review

Thanks!

>> Source/JavaScriptCore/runtime/IntlSegmenter.cpp:180
>> +        result->putDirect(vm, vm.propertyNames->isWordLike, jsBoolean(!(ruleStatus >= UBRK_WORD_NONE && ruleStatus <= UBRK_WORD_NONE_LIMIT)));
> 
> Seems like DeMorgan's rule wouldn't make this less clear?
>   jsBoolean(ruleStatus < UBRK_WORD_NONE || ruleStatus > UBRK_WORD_NONE_LIMIT)

I think that the current one is clear than < || > form since it is saying rulesStatus is not in this range.
Comment 5 Yusuke Suzuki 2020-07-25 22:44:34 PDT
Created attachment 405242 [details]
Rebaseline, test262
Comment 6 Yusuke Suzuki 2020-07-25 22:46:48 PDT
Update according to https://github.com/tc39/proposal-intl-segmenter/pull/128
Comment 7 Yusuke Suzuki 2020-07-25 22:47:48 PDT
Comment on attachment 405242 [details]
Rebaseline, test262

View in context: https://bugs.webkit.org/attachment.cgi?id=405242&action=review

> JSTests/test262/expectations.yaml:1688
> +test/intl402/Segmenter/prototype/segment/segment-grapheme.js:
> +  default: 'Test262Error: Expected SameValue(«0», «undefined») to be true'
> +  strict mode: 'Test262Error: Expected SameValue(«0», «undefined») to be true'
> +test/intl402/Segmenter/prototype/segment/segment-sentence.js:
> +  default: 'Test262Error: Expected SameValue(«0», «undefined») to be true'
> +  strict mode: 'Test262Error: Expected SameValue(«0», «undefined») to be true'
> +test/intl402/Segmenter/prototype/segment/segment-tostring.js:
> +  default: 'Test262Error: Expected segment "undefined", found "undefined" for arguments  Expected SameValue(«undefined», «undefined») to be true'
> +  strict mode: 'Test262Error: Expected segment "undefined", found "undefined" for arguments  Expected SameValue(«undefined», «undefined») to be true'
> +test/intl402/Segmenter/prototype/segment/segment-word.js:
> +  default: 'Test262Error: Expected SameValue(«0», «undefined») to be true'
> +  strict mode: 'Test262Error: Expected SameValue(«0», «undefined») to be true'

test262 will be fixed in https://github.com/tc39/test262/pull/2714
Comment 8 Yusuke Suzuki 2020-07-25 22:52:48 PDT
Created attachment 405243 [details]
Rebaseline + update
Comment 9 Yusuke Suzuki 2020-07-31 23:21:53 PDT
Created attachment 405769 [details]
Patch

Rebaseline
Comment 10 Yusuke Suzuki 2020-08-22 12:22:30 PDT
Committed r266032: <https://trac.webkit.org/changeset/266032>
Comment 11 Radar WebKit Bug Importer 2020-08-22 12:23:24 PDT
<rdar://problem/67621429>