Commit Graph

316 Commits

Author SHA1 Message Date
Frank Tang
b4e4d4150b Ship fractionalSecondDigits option to Intl.DateTimeFormatShip
I2S https://groups.google.com/a/chromium.org/forum/#!searchin/blink-dev/fractionalSecondDigits%7Csort:date/blink-dev/ISa0b6fOefY/pBlgkvZhBAAJ
I2P https://groups.google.com/a/chromium.org/forum/#!searchin/blink-dev/Intent$20to$20Implement$3A$20Add$20millisecondDigits$20option$20to$20Intl.DateTimeFormat%7Csort:date/blink-dev/WXd9nh03a1M/z7QeIMgrBgAJ
Chrome Status: https://www.chromestatus.com/feature/5704965743968256

Latest spec: https://github.com/tc39/ecma402/pull/347
LGTMs: bratell.d@gmail.com / chrishtr@chromium.org / mkwst@chromium.org

Bug: v8:9284
Change-Id: I4d2cca515ce65d41b38ebdef00b429fa873ea624
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2116989
Commit-Queue: Frank Tang <ftang@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67381}
2020-04-24 22:05:31 +00:00
Frank Tang
961e99d320 [intl] Remove two flags ship in m80
Remove harmony-intl-{other-calendars,add-calendar-numbering-system}
https://www.chromestatus.com/features/5440249461211136

Bug: v8:9154
Change-Id: I8331d3cbd55e19ab1b1f983fef2e772fa7dc856c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2163816
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67377}
2020-04-24 19:17:26 +00:00
Frank Tang
bf5312b6c7 [intl] Add failing test for v8:10437
Pick handful of failure cases from
https://bugs.chromium.org/p/v8/issues/detail?id=10437

Mark the test fail
The bug should be fixed by ICU67.1 and will be landed soon.

Bug: v8:10437
Change-Id: Iac309dd48b2220da777c006c7a35fac24e454430
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2161510
Commit-Queue: Frank Tang <ftang@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67345}
2020-04-23 17:10:17 +00:00
Frank Tang
c75296f62b [intl] Change the r/w order of fractionalSecondDigits
1. read and output into option after timeZoneName
2. Not output into resolvedOptions if dateStyle or timeStyle is presented.
3. Add unit test

Spec: https://github.com/tc39/ecma402/pull/347

Bug: v8:10438
Change-Id: Ie7fecdb5b6dc83dc9a6dfd8ced26679a4051c833
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2161509
Commit-Queue: Frank Tang <ftang@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67344}
2020-04-23 17:09:12 +00:00
Frank Tang
8ef3e03ea4 Fix special case timezone RangeError
Bug: chromium:364374
Change-Id: I361403b26529860c4240d06766a82937ee8ca115
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2150070
Commit-Queue: Frank Tang <ftang@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67158}
2020-04-15 18:19:00 +00:00
Frank Tang
7cba1ed502 Enable legacy locales "sh", "no", "tl"
Use new API available in ICU65.1 so legacy locales won't be hidden.

Bug: v8:9312,chromium:968269
Change-Id: I6e44501249cdb863ff9b1ab858efdf8908380a82
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2131373
Commit-Queue: Frank Tang <ftang@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66957}
2020-04-01 22:43:43 +00:00
Frank Tang
e0de3b6d42 Fix android test breakage due to lack of locale
Only run the test when locale 'bn' is supported

Bug: v8:9100
Change-Id: I455d77a7fb7495f1f866211084cdb68fceb8c871
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2130069
Commit-Queue: Frank Tang <ftang@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66956}
2020-04-01 21:34:33 +00:00
Iain Ireland
3fab9d05cf [regexp] Fix and unify non-unicode case-folding algorithms
Non-unicode, case-insensitive regexps (e.g. /foo/i, not foo/iu) use a
case-folding algorithm that doesn't quite match the Unicode
definition. There are two places in irregexp that need to do
case-folding. Prior to this patch, neither of them quite matched the
spec (https://tc39.es/ecma262/#sec-runtime-semantics-canonicalize-ch).

This patch implements the "Canonicalize" algorithm in
src/regexp/special-case.h, and uses it in the relevant places. It
replaces special-case logic around upper-casing / ASCII characters
with the following approach:

1. For most characters, calling UnicodeSet::closeOver on a set
   containing that character will produce the correct set of
   case-insensitive matches.

2. For a small handful of characters (like the sharp S that prompted
   this change), UnicodeSet::closeOver will include some characters
   that should be omitted. For example, although closeOver('ß') =
   "ßẞ", uppercase('ß') is "SS", so step 3.e means that 'ß'
   canonicalizes to itself, and should not match 'ẞ'. In these cases,
   we can skip the closeOver entirely, because it will never add an
   equivalent character. These characters are in the IgnoreSet.

3. For an even smaller handful of characters, UnicodeSet::closeOver
   will produce some characters that should be omitted, but also some
   characters that should be included. For example, closeOver('k') =
   "kKK" (lowercase k, uppercase K, U+212A KELVIN SIGN), but KELVIN
   SIGN should not match either of the other two (step 3.g). To handle
   this, we put such characters in the SpecialAddSet. In these cases,
   we closeOver the original character, but filter out the results
   that do not have the same canonical value.

The computation of IgnoreSet and SpecialAddSet happens at build time,
using the pre-existing gen-regexp-special-case.cc step.

R=jgruber@chromium.org

Bug: v8:10248
Change-Id: I00d48b180c83bb8e645cc59eda57b01eab134f0b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2072858
Reviewed-by: Frank Tang <ftang@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66641}
2020-03-10 11:09:28 +00:00
Frank Tang
8158c2160b Fix format of -NAN in toLocaleString()
Bug: chromium:1030160
Change-Id: I4e1b762b10c77ec671712355c61cdbb0b5f033da
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2068725
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66411}
2020-02-24 17:11:26 +00:00
Frank Tang
545f820c28 Reland "[Intl] Fix RelativeTimeFormat fatal"
Fix the gc_stress problem in Original by moving the
NewStringFromAsciiChecked before the cast.

This is a reland of a872c393c6

Original change's description:
> [Intl] Fix RelativeTimeFormat fatal
>
> Intl.RelativeTimeFormat constructor crash while the locale or
> numberingSystem contains an "algorithmic" numberingSystem.
> Fix by fallback to the locale without the nu
>
> Bug: chromium:1041319
> Change-Id: Ica520e8dec6ace21264504274b92cb2c3d16286f
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2055970
> Reviewed-by: Shu-yu Guo <syg@chromium.org>
> Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
> Commit-Queue: Frank Tang <ftang@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#66276}

Bug: chromium:1041319
Change-Id: I97563c5dbac1842a4e740e2450070471ea2681a0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2057761
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66315}
2020-02-18 18:29:08 +00:00
Frank Tang
dfe37934e1 Revert "[Intl] Fix RelativeTimeFormat fatal"
This reverts commit a872c393c6.

Reason for revert: break gc_stress

Original change's description:
> [Intl] Fix RelativeTimeFormat fatal
> 
> Intl.RelativeTimeFormat constructor crash while the locale or
> numberingSystem contains an "algorithmic" numberingSystem.
> Fix by fallback to the locale without the nu
> 
> Bug: chromium:1041319
> Change-Id: Ica520e8dec6ace21264504274b92cb2c3d16286f
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2055970
> Reviewed-by: Shu-yu Guo <syg@chromium.org>
> Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
> Commit-Queue: Frank Tang <ftang@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#66276}

TBR=jkummerow@chromium.org,ftang@chromium.org,syg@chromium.org

Change-Id: I2ccfda197103d7de37d704494eb03fbe9e51ccea
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:1041319
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2057760
Reviewed-by: Frank Tang <ftang@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66277}
2020-02-14 23:04:29 +00:00
Frank Tang
a872c393c6 [Intl] Fix RelativeTimeFormat fatal
Intl.RelativeTimeFormat constructor crash while the locale or
numberingSystem contains an "algorithmic" numberingSystem.
Fix by fallback to the locale without the nu

Bug: chromium:1041319
Change-Id: Ica520e8dec6ace21264504274b92cb2c3d16286f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2055970
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66276}
2020-02-14 21:49:39 +00:00
Clemens Backes
d6dd4a8d7c Revert "Fix SEGMAP_ERR by rolling ICU?"
This reverts commit 44380f804d.

Reason for revert: Breaks tsan, msan and ubsan, e.g. https://ci.chromium.org/p/v8/builders/ci/V8%20Linux64%20TSAN/30187

Original change's description:
> Fix SEGMAP_ERR by rolling ICU?
> 
> Fix Intl.ListFormat long strings cause SEGMAP_ERR
> Add slow regression test.
> 
> Bug: chromium:1044570
> Change-Id: I20e3523832ac3c69e88c11bd530122bbe782ad01
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2032712
> Reviewed-by: Shu-yu Guo <syg@chromium.org>
> Reviewed-by: Michael Achenbach <machenbach@chromium.org>
> Commit-Queue: Frank Tang <ftang@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#66140}

TBR=machenbach@chromium.org,ftang@chromium.org,syg@chromium.org

Change-Id: I079a675b754b413398d327c44bfeded9c7406333
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:1044570
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2039355
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66141}
2020-02-06 08:16:26 +00:00
Frank Tang
44380f804d Fix SEGMAP_ERR by rolling ICU?
Fix Intl.ListFormat long strings cause SEGMAP_ERR
Add slow regression test.

Bug: chromium:1044570
Change-Id: I20e3523832ac3c69e88c11bd530122bbe782ad01
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2032712
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66140}
2020-02-05 23:10:06 +00:00
Frank Tang
c82338295a Hide date related types from Intl.DisplayNames
To sync with https://github.com/tc39/proposal-intl-displaynames/pull/63

Bug: v8:10069
Change-Id: I64921c348a69ca7b265d498cac9e7da9f3e3f755
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1975038
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65530}
2019-12-19 19:31:09 +00:00
Frank Tang
565c4fee1d Implement the localeMatcher: "best fit"
Implement the ECMA402 localeMatcher: "best fit" option
by using ICU LocaleMatcher API.

Bug: v8:7051
Change-Id: I3d7c1ee39a5c649a5f500429f2b41329346a1a78
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1943050
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65507}
2019-12-18 20:58:08 +00:00
Frank Tang
162c5b0ff9 [Intl] Prototype Intl.DisplayNames
Design Doc https://shorturl.at/emEHW
I2I: http://shorturl.at/pKRUV

Bug: v8:8703
Change-Id: I9573b2ee6f1dce4dc594aa1df2753095f45af15e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1848683
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65021}
2019-11-18 21:48:22 +00:00
Frank Tang
fc5b196fa6 Roll to ICU 65.1
Remove fixed tests

Bug: v8:9876, chromium:1014272
Change-Id: Idde035073f630f29ad00d1c764bdef0a8528d2dc
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1891511
Commit-Queue: Frank Tang <ftang@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#64699}
2019-10-31 17:13:46 +00:00
Frank Tang
07437481c7 Fix hour cycle format
Afer the getBestPattern, replace the HhKk by the hour cycle char.
Not fix formatRange yet.

Bug: v8:9930
Change-Id: I0833539ba308d4b2f58f20ae1a137f782a82fe49
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1892126
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#64691}
2019-10-31 16:18:45 +00:00
Maya Lekova
a3fdb04161 [test] Allow PASS, FAIL temporarily for intl tests
Bug: v8:9876, v8:9932
Change-Id: Ib123a163f2b0bf96f4ef2248c22709d33bc9328a

No-Try: true
Change-Id: Ib123a163f2b0bf96f4ef2248c22709d33bc9328a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1893340
Auto-Submit: Maya Lekova <mslekova@chromium.org>
Commit-Queue: Nico Hartmann <nicohartmann@chromium.org>
Reviewed-by: Nico Hartmann <nicohartmann@chromium.org>
Cr-Commit-Position: refs/heads/master@{#64685}
2019-10-31 15:08:08 +00:00
Frank Tang
6a44b75098 Remove keyword/value "ca" and "nu" from locale
Remove unicode keyword/value "ca" and "nu" from
the resolvedOptions().locale, if it does not match
the option "calendar" / "numberingSystem".

Bug: v8:9887
Change-Id: Idabc7e266e8e5f847f919324a93e39df4df440c8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1877708
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#64663}
2019-10-30 21:00:08 +00:00
Frank Tang
e64fa14fa0 Fix the format of date range older than Oct 15 1582
Bug: v8:9912
Change-Id: Ib9deba176f7aaa2ffca2db811c5273af673028ca
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1884955
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#64621}
2019-10-29 18:12:25 +00:00
Adam Klein
6c41668e6f Update test/intl OWNERS
Remove inactive contributors (cira and mnita) and add ftang and jshin.

Change-Id: Ibd1e4f11553b78e1cd938a7ce8958fe5341829d2
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1872540
Reviewed-by: Frank Tang <ftang@chromium.org>
Commit-Queue: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#64484}
2019-10-22 17:29:36 +00:00
Simon Zünd
2d4fe83a43 Remove 'embedded_builtins' variant
Embedded builtins are now unconditionally enabled, which removes the
need to differentiate between enabled/disabled embedded builtins.

This Cl removes the 'embedded_builtins' variant and related
*.status entries.

R=machenbach@chromium.org

Bug: v8:8519
Change-Id: I55d0dd54735b7cc437832af6fa2836fd6c14a317
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1864936
Commit-Queue: Simon Zünd <szuend@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#64464}
2019-10-22 12:58:02 +00:00
Frank Tang
4eddc6c524 Correct expectation of Infinity -Infinity and NaN
Bug: v8:9876
Change-Id: I2ca4512790e0a84b6f4ebd67bce76b7eb24eb33c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1867793
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Reviewed-by: Adam Klein <adamk@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#64439}
2019-10-21 20:48:44 +00:00
Frank Tang
787cd95fef Fix crash bug with some numberingSystem and dateStyle/timeStyle
Bug: v8:9849
Change-Id: Ib7812e27dcacb30fd2610badbf79dee190fdec15
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1869078
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#64436}
2019-10-21 20:12:54 +00:00
Frank Tang
4c1e09a4e9 [Intl] Only set HourCycle if needed
* Change the logic to reflect the spec change of
  https://github.com/tc39/proposal-intl-datetime-style/pull/37/
* Move enum value of kUndefined to 0 to make unset behavior the same as
  kUndefined.
* Change the expectation of existing tests
* Additional tests - https://github.com/tc39/test262/pull/2385

Bug: v8:9826
Change-Id: Ic437b5f6414aa641ae73766d8c5fd5b9d352a230
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1846722
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#64255}
2019-10-11 20:44:17 +00:00
Frank Tang
f5dac714ad Fix crash in creating NumberFormat
setUnicodeKeywordValue doesn't remove unrelated keyword/value pairs
when the locale is too long, which causes NumberFormat to fail when
calling createInstance. Fix this by using LocaleBuilder to add keyword/value
into a new locale instead of removing the keyword.

Also see https://unicode-org.atlassian.net/browse/ICU-20862

Bug: chromium:1012579
Change-Id: I0f664f60dad8fe786443c8ca8b21ea43323cbf49
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1855586
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#64253}
2019-10-11 20:42:06 +00:00
Frank Tang
f156560621 Roll icu
Bug: v8:9812
Change-Id: I6ca086a6efde614e8296c25aafa823349237e988
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1854896
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#64231}
2019-10-11 06:58:50 +00:00
Frank Tang
a0bd6602c3 [test] Remove incorrect expectation
Remove test expectations whose behavior is not specified or contradicts
the Stage 3 PR https://github.com/tc39/ecma402/pull/349 which we plan
to land soon.

The Chinese calendar (and other calendars) now need to choose
different patterns for non-default calendars to support the correct
behavior.

Bug: v8:9320
Change-Id: Ia84e0eb1f7244b0d2d252071cf985d97f2acec58
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1838437
Commit-Queue: Frank Tang <ftang@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#64149}
2019-10-07 22:33:49 +00:00
Frank Tang
d22b954c0e [Intl] Add test for calendar of formatRange
Bug: v8:9812
Change-Id: I222b9c3c8c87e83b61009c84e2ab0499187308e0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1842623
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#64147}
2019-10-07 22:31:39 +00:00
Frank Tang
246d985cb7 [Intl] No throwing RangeError when "calendar" and "numberingSystem" are well-formed
* Throws RangeError only when the calendar and numberingSystem is
  ill-formed.
* Set the calendar and numberingSystem to the locale only if
the values are valid.
* Fix the order of GetOption of "localeMatcher".
* Add more unit tests.
See https://github.com/tc39/ecma402/pull/175 for details.

Bug: v8:9786, v8:9787, v8:9788
Change-Id: Ic0f918ad7d9afb0b7c8df39caa0f44ef07ca10c0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1830345
Commit-Queue: Frank Tang <ftang@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#64070}
2019-10-01 18:04:12 +00:00
Frank Tang
a0133350bf [Intl] Fix /ſ/i.test('ſ'.toUpperCase()) be false.
Address special case condiction for U+017F.

Bug: v8:9356
Change-Id: Id24e5e2c999b198bf0f696aea8c98f223508c051
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1827683
Commit-Queue: Frank Tang <ftang@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#64028}
2019-09-27 18:13:00 +00:00
Frank Tang
7dedd92998 [Intl] Fix /k/i.test('\u212A')
Add logic stated in

Bug: v8:9731
Change-Id: I0b3468bbad11a178f36d682febd0e44214646de8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1828279
Commit-Queue: Frank Tang <ftang@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#64027}
2019-09-27 17:37:50 +00:00
Frank Tang
aad8c7f81b [Intl] Implement ECMA402 PR 349 and 351
It is controlled by flag harmony_intl_other_calendars.
But this is also pretty intern-dependent with
harmony_intl_add_calendar_numbering_system and should be launched
all together to be meaningful.

https://github.com/tc39/ecma402/pull/349/
#349 Normative: Allow calendar to determine choice of pattern

https://github.com/tc39/ecma402/pull/351
#351 Normative: Permit relatedYear and yearName in output



Bug: v8:9155
Change-Id: I67cd6bba6276bbb995186a9fe6202429d724ba61
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1588401
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#63972}
2019-09-25 19:53:48 +00:00
Frank Tang
8d1b4774bf [Intl] Sync ListFormat to latest spec.
1. Add StringListFromIterable based on
https://tc39.es/proposal-intl-list-format/#sec-createstringlistfromiterable
2. Adjust other parts to sync with the new version.

Bug: v8:9747
Change-Id: I14202f2963463e6a3e9816209f087bfe8e73cb91
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1809902
Commit-Queue: Frank Tang <ftang@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#63899}
2019-09-19 20:02:53 +00:00
Frank Tang
9849000141 [Intl] Fix m(ax|in)imumFractionDigits for currency
Fix m(ax|in)imumFractionDigits of Intl.NumberFormat
resolvedOptions are set to 0. For example, currency
instance for CPY or KRW.

Bug: chromium:1003748
Change-Id: Ia1963d8d070b066bd5afa61f8c4716a21450af05
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1807742
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#63850}
2019-09-17 16:34:00 +00:00
Frank Tang
133219ad5c [Intl] Throws exception on grandfather and private locale
Bug: v8:9613
Change-Id: Ie91a5bd39c82b6baf33fd84dee8420d2c4a5f504
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1803783
Commit-Queue: Frank Tang <ftang@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#63815}
2019-09-16 20:59:11 +00:00
Jakob Kummerow
b823bf1ba6 [test][cleanup] Revive --time, speed up some tests
This reimplements the "--time" option of run-tests.py to print the
20 slowest tests, on top of json_test_results infrastructure just
like the bots do it.
Additionally this CL speeds up a bunch of slow tests.

Bug: v8:9396
Change-Id: I40797d2c8c3bfdd310b72f15cd1a035844b7c6f3
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1803635
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#63786}
2019-09-16 11:24:11 +00:00
Frank Tang
fad60ef290 [Intl] Fix Hungarian number format grouping
By rolling icu to faee8bc which contains the upstream CLDR fix.

Bug: v8:992694
Change-Id: I073d15396fa0e7c5054aa4e0806e5842228955f0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1799424
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#63768}
2019-09-13 17:14:41 +00:00
Frank Tang
9d2591a695 Correct the name of the regression test
Bug: v8:9464
Change-Id: Ibdc6f9797661e357e01c2f02565eeca12abbf8ae
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1801251
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#63764}
2019-09-13 16:14:50 +00:00
Frank Tang
25c11657fc [Intl] Clean up by removing the following flags
harmony_intl_bigint shipped in m76
  harmony_intl_date_format_range shipped in m76
  harmony_intl_datetime_style shipped in m76
  harmony_intl_numberformat_unified shipped in m77

Bug: v8:9272, v8:9273, v8:9274
Change-Id: Icc640e011021e691373bc61725013578b7185e50
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1799263
Commit-Queue: Frank Tang <ftang@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#63736}
2019-09-12 22:25:41 +00:00
Frank Tang
6cf125a90c [Intl] Fix error message to report the right method.
Bug: v8:9464
Change-Id: I3252de850bbaa5fdb15f5fc2103f1ebb7be3e1ea
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1799396
Commit-Queue: Frank Tang <ftang@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#63734}
2019-09-12 19:32:31 +00:00
Frank Tang
8574ecf2b7 Remove CHECK which fail while the locale is long.
Bug: chromium:997401
Change-Id: I7a78f4ad1fd05ab2bb2dbcd343060b2647aef4e6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1771954
Commit-Queue: Frank Tang <ftang@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#63660}
2019-09-10 19:28:54 +00:00
Frank Tang
b8cdfe5565 Fix crash under lb_LU locale
Bug: v8:9642
Change-Id: I2dcd1c0e3c208b15b5c0ec0f08880744134f7474
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1769479
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#63404}
2019-08-26 17:07:12 +00:00
Frank Tang
5bd577834b [Intl] Adding volume units.
Add 'fluid-ounce','gallon', 'liter', and 'milliliter'
Also roll ICU to 682a2309

Sync with https://github.com/tc39/proposal-unified-intl-numberformat/pull/48


Bug: v8:9475
Change-Id: If45a20f17f5973b860893b0f70e724cc93c6550a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1699759
Commit-Queue: Frank Tang <ftang@chromium.org>
Reviewed-by: Jungshik Shin <jshin@chromium.org>
Reviewed-by: Adam Klein <adamk@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62903}
2019-07-24 17:16:46 +00:00
Frank Tang
76f789c334 [Intl] Fix crash bug of formatToParts and -0
1. Fix formatToParts show "plusSign" for -0 by using signbit instead of < 0
2. Fix crash bug of formatToParts while notation is either "engineering" or
   "scientific".

Bug: v8:9513
Change-Id: I36b0b995c157dc642b9c201694d0ac0bb0396988
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1710148
Commit-Queue: Frank Tang <ftang@chromium.org>
Reviewed-by: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62856}
2019-07-22 17:28:20 +00:00
Frank Tang
f0d3772110 [Intl] Change the behavior of percent format under "unit"
1. Sync with
https://github.com/tc39/proposal-unified-intl-numberformat/pull/57
so the formatting of {style: "unit" unit: "percent"} and
the formatting of {style: "percent:"} are treated different that
simplified the algorithm.
2. Store style into bit flags because we need it quickly during format.
3. Add more unit tests and regression test.

Bug: v8:9498
Change-Id: I75ed22fef1feb73ebf624bda70ebe45b80e7bc8b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1704948
Reviewed-by: Adam Klein <adamk@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62834}
2019-07-19 21:33:13 +00:00
Frank Tang
f4e3da5585 [Intl] camelCase except-zero and narrow-symbol
Sync with https://github.com/tc39/proposal-unified-intl-numberformat/pull/54

Bug: v8:9483
Change-Id: I2aec5a78be235bddd4faa568665b73b9b84d7c93
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1700426
Reviewed-by: Adam Klein <adamk@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62819}
2019-07-19 03:36:43 +00:00
Frank Tang
2f1e0b76e6 Roll icu and fix tests
test262 changes already merged in
9d0072df3d1897a63738b029b3e8d00df18d1201
but not roll into v8 yet.

Bug: v8:9327, chromium:980085
Change-Id: I0a97e1038ab8a68d439a78512ef513b3510478d5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1684703
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62482}
2019-07-02 06:39:21 +00:00