Bug 233539

Summary: [JSC] Add Intl.NumberFormat.formatRangeToParts
Product: WebKit Reporter: Yusuke Suzuki <ysuzuki>
Component: New BugsAssignee: Yusuke Suzuki <ysuzuki>
Status: RESOLVED FIXED    
Severity: Normal CC: ews-watchlist, keith_miller, mark.lam, msaboff, ross.kirsling, saam, tzagallo, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 218829    
Attachments:
Description Flags
Patch
none
Patch
none
Patch ross.kirsling: review+

Description Yusuke Suzuki 2021-11-27 23:11:00 PST
[JSC] Add Intl.NumberFormat.formatRangeToParts
Comment 1 Yusuke Suzuki 2021-11-27 23:11:14 PST
Created attachment 445234 [details]
Patch
Comment 2 Yusuke Suzuki 2021-11-28 21:44:17 PST
Created attachment 445248 [details]
Patch
Comment 3 Yusuke Suzuki 2021-11-28 22:12:35 PST
Created attachment 445249 [details]
Patch
Comment 4 Ross Kirsling 2021-11-29 12:11:10 PST
Comment on attachment 445249 [details]
Patch

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

r=me, very nice.

> Source/JavaScriptCore/runtime/IntlNumberFormat.cpp:1511
> +        auto partValue = jsSubstring(vm, formatted, field.m_range.begin(), field.m_range.end() - field.m_range.begin());

Wonder if we should add a method to WTF::Range for this?
Comment 5 Yusuke Suzuki 2021-11-29 12:15:50 PST
Comment on attachment 445249 [details]
Patch

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

>> Source/JavaScriptCore/runtime/IntlNumberFormat.cpp:1511
>> +        auto partValue = jsSubstring(vm, formatted, field.m_range.begin(), field.m_range.end() - field.m_range.begin());
> 
> Wonder if we should add a method to WTF::Range for this?

Added Range::distance method, which is aligned to STL's naming (begin, end, distance).
Comment 6 Yusuke Suzuki 2021-11-29 12:29:13 PST
Committed r286255 (244618@main): <https://commits.webkit.org/244618@main>
Comment 7 Radar WebKit Bug Importer 2021-11-29 12:30:23 PST
<rdar://problem/85829885>