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
Depends on Patchset: Messages
Total messages: 35 (26 generated)
|