Bug 215985 - [JSC] Use UNumberFormatter unconditionally
Summary: [JSC] Use UNumberFormatter unconditionally
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Yusuke Suzuki
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-08-30 01:05 PDT by Yusuke Suzuki
Modified: 2020-09-06 01:06 PDT (History)
8 users (show)

See Also:


Attachments
Patch (27.71 KB, patch)
2020-08-30 01:07 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (27.71 KB, patch)
2020-08-30 01:10 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-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>