Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(14)

Issue 2736543002: [intl] Implement Intl.PluralRules

Created:
3 years, 9 months ago by Dan Ehrenberg
Modified:
3 years, 5 months ago
CC:
v8-reviews_googlegroups.com, Michael Hablich
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

[intl] Implement Intl.PluralRules This patch implements the Stage 3 proposal to add a binding to ICU exposing a mapping by locale from numbers to plural categories. This proposal is currently implemented behind a flag in SpiderMonkey and spec text is available at https://rawgit.com/caridy/intl-plural-rules-spec/master/index.html A couple issues with this implementation which we may want to resolve before shipping: - It's not clear to me what the right interface is to get the supported locales for PluralRules. This implementation copies Mozilla's approach of pretending all locales in the system are supported, but that might not be correct. ICU bug: https://ssl.icu-project.org/trac/ticket/12756 - The Intl code is generally a bit roundabout and duplicated. This implementation proceeds in the style of the surrounding code, but it would be preferable to do more work to clean up the surrounding code before adding too many more features in this style. - Testing is not so complete; test262 tests have some gaps. Firefox has some better tests internally (js/src/tests/Intl/PluralRules); I think the best thing here would be to upstream those into test262. BUG=v8:5601

Patch Set 1 #

Patch Set 2 : A couple little fixes #

Patch Set 3 : Get the flag working and fix a bug in property declaration #

Patch Set 4 : Get the flag working and fix a bug in property declaration #

Patch Set 5 : Rebase #

Patch Set 6 : Rebase #

Patch Set 7 : Reduce code duplication #

Patch Set 8 : clarify comment #

Total comments: 10
Unified diffs Side-by-side diffs Delta from patch set Stats (+520 lines, -94 lines) Patch
M src/bootstrapper.cc View 1 2 3 chunks +35 lines, -0 lines 0 comments Download
M src/contexts.h View 1 chunk +1 line, -0 lines 0 comments Download
M src/flag-definitions.h View 2 chunks +9 lines, -1 line 0 comments Download
M src/i18n.h View 1 2 2 chunks +38 lines, -0 lines 3 comments Download
M src/i18n.cc View 1 2 3 4 5 6 9 chunks +244 lines, -90 lines 4 comments Download
M src/js/i18n.js View 1 2 5 chunks +102 lines, -2 lines 0 comments Download
M src/runtime/runtime.h View 2 1 chunk +2 lines, -0 lines 0 comments Download
M src/runtime/runtime-i18n.cc View 1 2 3 4 5 6 7 3 chunks +85 lines, -0 lines 3 comments Download
M test/test262/test262.status View 1 2 2 chunks +4 lines, -1 line 0 comments Download

Depends on Patchset:

Messages

Total messages: 35 (26 generated)
Dan Ehrenberg
3 years, 9 months ago (2017-03-05 13:35:08 UTC) #24
adamk
From reading the CL description, it sounds like you think there's some cleanup to be ...
3 years, 9 months ago (2017-03-16 22:50:04 UTC) #28
Dan Ehrenberg
On 2017/03/16 22:50:04, adamk wrote: > From reading the CL description, it sounds like you ...
3 years, 9 months ago (2017-03-17 09:45:57 UTC) #29
adamk
On 2017/03/17 09:45:57, Dan Ehrenberg wrote: > On 2017/03/16 22:50:04, adamk wrote: > > From ...
3 years, 9 months ago (2017-03-17 20:46:17 UTC) #30
Dan Ehrenberg
On 2017/03/17 20:46:17, adamk wrote: > On 2017/03/17 09:45:57, Dan Ehrenberg wrote: > > On ...
3 years, 9 months ago (2017-03-17 22:59:07 UTC) #31
jungshik at Google
Sorry for terrible delay. I guess a lot of codes have been shuffled around since ...
3 years, 7 months ago (2017-05-08 19:16:54 UTC) #32
jungshik at Google
https://codereview.chromium.org/2736543002/diff/140001/src/i18n.h File src/i18n.h (right): https://codereview.chromium.org/2736543002/diff/140001/src/i18n.h#newcode134 src/i18n.h:134: // http://bugs.icu-project.org/trac/ticket/12763 On 2017/05/08 19:16:54, jungshik at Google wrote: ...
3 years, 7 months ago (2017-05-19 05:28:34 UTC) #33
jungshik at Google
On 2017/05/19 05:28:34, jungshik at Google wrote: > https://codereview.chromium.org/2736543002/diff/140001/src/i18n.h > File src/i18n.h (right): > > ...
3 years, 6 months ago (2017-06-09 22:21:44 UTC) #34
Dan Ehrenberg
3 years, 5 months ago (2017-07-14 08:31:50 UTC) #35
https://codereview.chromium.org/2736543002/diff/140001/src/runtime/runtime-i1...
File src/runtime/runtime-i18n.cc (right):

https://codereview.chromium.org/2736543002/diff/140001/src/runtime/runtime-i1...
src/runtime/runtime-i18n.cc:707: //
http://bugs.icu-project.org/trac/ticket/12763
On 2017/05/08 19:16:54, jungshik at Google wrote:
> Fixed in ICU 59.1. Either wait for me to update Chrome/V8's ICU to 59.1 (will
> happen before long) or land first and fix it later. 

Looks like that API is C-only. I posted a comment on that bug asking for a C++
API; until then, do you think there are any problems from continuing with the
current approach?

Powered by Google App Engine
This is Rietveld 408576698