Use intl::NumberFormat to format numbers in SpiderMonkey
Categories
(Core :: Internationalization, enhancement, P1)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox90 | --- | fixed |
People
(Reporter: dminor, Assigned: dminor)
References
(Blocks 1 open bug)
Details
(Whiteboard: [i18n-unification])
Attachments
(9 files, 1 obsolete file)
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review |
Once the "unified" intl::NumberFormat implementation lands in Bug 1695937, the next step will be to support the full Intl.NumberFormat API, and switch SpiderMonkey over to using it.
| Assignee | ||
Comment 1•4 years ago
|
||
| Assignee | ||
Comment 2•4 years ago
|
||
This temporarily adds intl::NumberFormatterSkeleton to the public API so that
we can use it in PluralRules. This allows us to remove the SpiderMonkey
NumberFormatterSkeleton implementation when we convert SpiderMonkey to use
intl::NumberFormat.
We can remove intl::NumberFormatterSkeleton from the public API when we
implement intl::PluralRules in Bug 1704509.
Depends on D111886
| Assignee | ||
Comment 3•4 years ago
|
||
Depends on D111887
| Assignee | ||
Comment 4•4 years ago
|
||
The SpiderMonkey call sites need both the pointer and the length when
copying/deflating the string, so this changes the API to expose the underlying
string_view.
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
| Assignee | ||
Comment 5•4 years ago
|
||
Depends on D111888
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
| Assignee | ||
Comment 6•4 years ago
|
||
Depends on D112802
| Assignee | ||
Comment 7•4 years ago
|
||
This should be CurrencyDisplay to be consistent with ecma-402.
Depends on D112801
| Assignee | ||
Comment 8•4 years ago
|
||
I foolishly dropped these when bringing the code over from SpiderMonkey.
Depends on D113557
| Assignee | ||
Comment 9•4 years ago
|
||
| Assignee | ||
Comment 10•4 years ago
|
||
This adds a fallible factory method to create new NumberFormat instances. This
allows us to report initialization errors at time of initialization, rather than
when format is called, and remove internal checks in the implementation for
successful initialization.
To support using the SpiderMonkey allocators, the TryCreate method optionally
takes an allocator as an argument and a DeletePolicy as template argument.
Default values are provided so that these do not need to be specified in Gecko
code.
The existing fluent code assumes that creating a NumberFormat instance always
succeeds. This patch updates that code to handle failures.
Depends on D113145
| Assignee | ||
Comment 11•4 years ago
|
||
This adds a fallible factory method to create new NumberFormat instances. This
allows us to report initialization errors at time of initialization, rather than
when format is called, and remove internal checks in the implementation for
successful initialization.
The existing fluent code assumes that creating a NumberFormat instance always
succeeds. This patch updates that code to handle failures.
Depends on D113145
Updated•4 years ago
|
| Assignee | ||
Comment 12•4 years ago
|
||
| Assignee | ||
Comment 13•4 years ago
|
||
All the SpiderMonkey jobs, just in case: https://treeherder.mozilla.org/jobs?repo=try&revision=58f5f40a0ac272e4e07cdadf0eec96325caa9e0e
Comment 14•4 years ago
|
||
Comment 15•4 years ago
|
||
Backed out 9 changesets (bug 1701695) for causing xpcshell failures in test_messagecontext.js.
https://hg.mozilla.org/integration/autoland/rev/a5ce805152fe2d4a4603eb39121b03c3a1886afd
Push with failures:
https://treeherder.mozilla.org/jobs?repo=autoland&revision=e88dd41c0a9000090b88b332be4af27c94fae9e2&selectedTaskRun=MLSmHXT1QqGN2a1DdBH1JQ.0
Failure log:
https://treeherder.mozilla.org/logviewer?job_id=339378415&repo=autoland&lineNumber=3439
| Assignee | ||
Comment 16•4 years ago
|
||
The problem is with these changes: https://phabricator.services.mozilla.com/D112801. I've only seen it on Android so far. The ICU calls seem to all succeed, an Ok() is returned from formatResult(), but on the FluentBundle side it looks we get an Err, and return a nullptr which results in an empty string in Fluent.
| Assignee | ||
Comment 17•4 years ago
|
||
Moving the Buffer definition out of the FluentBuiltInNumberFormatterFormat fixes things for me locally and on try [1]. I would not have expected that to make a difference, but since this was a change we had planned to make anyway to support DateTimeFormat, I'll take it.
[1] https://treeherder.mozilla.org/jobs?repo=try&revision=86fa769f5651d4d9b7163532dc8e32af9e5e3ac1
| Assignee | ||
Comment 18•4 years ago
|
||
Comment 19•4 years ago
|
||
Comment 20•4 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/56618c50daff
https://hg.mozilla.org/mozilla-central/rev/e787260f77b9
https://hg.mozilla.org/mozilla-central/rev/f3a30633d181
https://hg.mozilla.org/mozilla-central/rev/1c26ef25db84
https://hg.mozilla.org/mozilla-central/rev/382a076bc5a0
https://hg.mozilla.org/mozilla-central/rev/da5fdc32ae9b
https://hg.mozilla.org/mozilla-central/rev/666e43ab82df
https://hg.mozilla.org/mozilla-central/rev/ecd5abbb0ffc
https://hg.mozilla.org/mozilla-central/rev/67f15404db7c
Updated•4 years ago
|
Description
•