Bug 215985

Summary: [JSC] Use UNumberFormatter unconditionally
Product: WebKit Reporter: Yusuke Suzuki <ysuzuki>
Component: New BugsAssignee: Yusuke Suzuki <ysuzuki>
Status: NEW ---    
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   
Attachments:
Description Flags
Patch
none
Patch none

Description Yusuke Suzuki 2020-08-30 01:05:49 PDT
[JSC] Use UNumberFormatter unconditionally
Comment 1 Yusuke Suzuki 2020-08-30 01:07:59 PDT
Created attachment 407564 [details]
Patch
Comment 2 Yusuke Suzuki 2020-08-30 01:10:14 PDT
Created attachment 407565 [details]
Patch
Comment 3 Yusuke Suzuki 2020-08-30 01:14:00 PDT
Comment on attachment 407565 [details]
Patch

Hm, maybe, we should check `OS(DARWIN)`.
Comment 4 Ross Kirsling 2020-08-30 01:41:17 PDT
Comment on attachment 407565 [details]
Patch

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

> Source/JavaScriptCore/runtime/IntlNumberFormat.cpp:43
> +// They later become stable APIs.
> +#if U_ICU_VERSION_MAJOR_NUM < 64
> +static constexpr UNumberFormatFields UNUM_MEASURE_UNIT_FIELD = static_cast<UNumberFormatFields>(11);
> +static constexpr UNumberFormatFields UNUM_COMPACT_FIELD = static_cast<UNumberFormatFields>(12);

The comment here seems a bit misleading -- these symbols don't even exist as draft API before that point, right?

> Source/JavaScriptCore/runtime/IntlNumberFormat.cpp:46
> +static_assert(static_cast<int32_t>(UNUM_COMPACT_FIELD ) == 12);

Whoops, style checker is rightly complaining about the extra space here.

> Source/JavaScriptCore/runtime/IntlNumberFormat.h:37
> +#define U_HIDE_DRAFT_API

Hmm, seems a bit odd that we #ifdef U_HIDE_DRAFT_API and then re-#define it unconditionally.

> JSTests/test262/expectations.yaml:1638
> +test/intl402/NumberFormat/prototype/format/engineering-scientific-de-DE.js:

So are these all now failing for different reasons that we can address separately then?
Comment 5 Radar WebKit Bug Importer 2020-09-06 01:06:12 PDT
<rdar://problem/68417474>