Commit Graph

354 Commits

Author SHA1 Message Date
Leszek Swirski
b90717df29 [intl] Fix timezone bug in test
If we're testing printing in UTC timezone, then we have to be careful to
also input the date in UTC, else local timezone will affect the test.

Fixed: chromium:1135116
Change-Id: I49981c263e7b1fa1492b4644c5d4846fd94e5613
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2448793
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Santiago Aboy Solanes <solanes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70312}
2020-10-05 14:41:51 +00:00
Frank Tang
940d11ecee Reland "[intl] Impl ECMA402 PR 471 rounding behavior"
This is a reland of 40af6aeebf

Change from the rollbacked version
- removes the passed test fixed by this PR in test/test262/test262.status

TBR=jkummerow@chromium.org

Original change's description:
> [intl] Impl ECMA402 PR 471 rounding behavior
>
> Fix awkward rounding behavior
> Change Intl::SetNumberFormatDigitOptions to fix the awkward rounding
> behavior in NumberFormat when formatting a currency with
> "maximumFractionDigits" set to a value less than 2.
>
> Bug: v8:10844
> Change-Id: I2ff4afa9f747cd79cb9964fe4c77a0dd2b8977b5
> Refs: https://github.com/tc39/ecma402/pull/471
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2442191
> Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
> Commit-Queue: Frank Tang <ftang@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#70270}

Bug: v8:10844
Change-Id: Icfe7363f63d402abccc038e2b8bd78b38d0d9c49
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2444210
Commit-Queue: Frank Tang <ftang@chromium.org>
Reviewed-by: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70273}
2020-10-02 00:14:46 +00:00
Zhi An Ng
c5f960a83b Revert "[intl] Impl ECMA402 PR 471 rounding behavior"
This reverts commit 40af6aeebf.

Reason for revert: Test262 failures, see https://ci.chromium.org/p/v8/builders/ci/V8%20Linux%20-%20arm64%20-%20sim%20-%20CFI/2509?

Original change's description:
> [intl] Impl ECMA402 PR 471 rounding behavior
>
> Fix awkward rounding behavior
> Change Intl::SetNumberFormatDigitOptions to fix the awkward rounding
> behavior in NumberFormat when formatting a currency with
> "maximumFractionDigits" set to a value less than 2.
>
> Bug: v8:10844
> Change-Id: I2ff4afa9f747cd79cb9964fe4c77a0dd2b8977b5
> Refs: https://github.com/tc39/ecma402/pull/471
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2442191
> Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
> Commit-Queue: Frank Tang <ftang@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#70270}

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

Change-Id: I1cfc05e0e2015ad18c037003c9a9a414e2151e06
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:10844
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2441549
Reviewed-by: Zhi An Ng <zhin@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70271}
2020-10-01 20:10:17 +00:00
Frank Tang
40af6aeebf [intl] Impl ECMA402 PR 471 rounding behavior
Fix awkward rounding behavior
Change Intl::SetNumberFormatDigitOptions to fix the awkward rounding
behavior in NumberFormat when formatting a currency with
"maximumFractionDigits" set to a value less than 2.

Bug: v8:10844
Change-Id: I2ff4afa9f747cd79cb9964fe4c77a0dd2b8977b5
Refs: https://github.com/tc39/ecma402/pull/471
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2442191
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70270}
2020-10-01 19:07:54 +00:00
Frank Tang
be3550bf70 Fix "japanese" and "chinese" calendar
Roll the icu to include the fix. The roll include previously
mistakenly filter out required resources.
Fix "japanese" under "ja" and calendar: "chinese" under "zh"
Depends on https://chromium-review.googlesource.com/c/chromium/deps/icu/+/2433166

This CL prepare for such landing:
1. Add test to show the correct result.
2. Wrap the number format static cast to DecimalFormat only if
   the concrete class is DecimalFormat. This is needed after the landing
   because the new resource enable other subclass of NumberFormat.
3. Change test to allow the additional numberingSystems.

Roll the the DEPS of chromium in
https://chromium-review.googlesource.com/c/chromium/src/+/2437820

Bug: v8:10960
Change-Id: Ib10b11862a093d1d487070f79556505bfc10bcc5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2432801
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70253}
2020-10-01 10:32:42 +00:00
Frank Tang
07e0c55538 [date] Fix crash by invalid TimeZone "US/x0" names.
Bug: chromium:1132641
Change-Id: Ifa005f9c901ccc865159b618e5145b6d83293b2a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2436078
Commit-Queue: Frank Tang <ftang@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70182}
2020-09-28 21:34:34 +00:00
Frank Tang
2b2ebc3b24 Fix fuzzer problem due to allocation of string
Bug: chromium:1130489
Change-Id: I506f2ea418bf3bde9468126534df9d78337e5f82
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2422086
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70073}
2020-09-22 19:53:28 +00:00
Frank Tang
46e06ad8fd Fix locale of Intl.Collator..resolvedOptions
Bug: v8:7481, v8:9084, v8:8664
Change-Id: Iccbf78bf11a4e8ca5d105772fa5f654fbe6542cd
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2410791
Commit-Queue: Frank Tang <ftang@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69951}
2020-09-16 15:53:09 +00:00
Frank Tang
5d988ea326 Use better error messages for dateStyle/timeStyle
Bug: v8:10880
Change-Id: I7a9ba96e4b0c83565c4749101082c661e21d5ef1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2400598
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Frank Tang <ftang@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69844}
2020-09-11 11:26:50 +00:00
Frank Tang
1f17cfaeaa Change the order of the DateTimeFormat resolved
Move fractionalSecondsDigits between second and timeZoneName
Change order of reading options.
To sync with the July 20 PR change in
ba085a9111
Latest ECMA402 PR https://github.com/tc39/ecma402/pull/347

Bug: v8:10836
Change-Id: Ia414e0c7cc18502ccabaf02abd19861410b87cae
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2378460
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69591}
2020-08-27 20:39:05 +00:00
Frank Tang
db1115e267 [Intl] Fix Heap-use-after-free
Fix Heap-use-after-free READ 2 in Intl.Segmenter
when the segments got free during the iteration
We need to keep a copy of the string in the iterator instead
of depending on the one referenced from the segments.

Bug: chromium:1121156, v8:6891
Change-Id: I26ef5baccaa470dc1bd8cc229c737f556d27160e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2376173
Commit-Queue: Frank Tang <ftang@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69575}
2020-08-26 20:27:10 +00:00
Frank Tang
e8a5793abc Skip tests on Andriod dep on Chinese dict.
Bug: v8:10819
Change-Id: I91cf658d9fdcbaf58d6b2e5734c59d7248b8393e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2369461
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69524}
2020-08-21 20:57:47 +00:00
Frank Tang
ebaf3feed4 Improve test cases for Intl.Segmenter
Fix containing() w/ n point to surrogate tail.

Bug: v8:6891
Change-Id: I4d7e4083ba409eecaefaf2ec5c67b7226bd7c97c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2348208
Commit-Queue: Frank Tang <ftang@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69363}
2020-08-12 18:53:07 +00:00
Frank Tang
439c868ffa [Intl] Define @@toStringTag for Intl namespace
Implement https://github.com/tc39/ecma402/pull/487
Also improve test/intl/toStringTag.js

see also: https://github.com/tc39/test262/pull/2712

Bug: v8:10744
Change-Id: I678876aa21f169a8dfcec8e3ce974978a8847fe0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2315455
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69185}
2020-08-01 02:21:20 +00:00
Frank Tang
4f87e1a045 Reland "[Intl] Sync Intl.Segmenter to latest version"
This is a reland of 482c3bbf1e

Original change's description:
> [Intl] Sync Intl.Segmenter to latest version
> 
> https://tc39.es/proposal-intl-segmenter/
> 
> TC39 passed Intl.Segmenter to stage 3 in Jul 21.
> This CL move our earlier prototype to the current spec.
> 
> Bug: v8:6891
> Change-Id: I07234beed54f671c26bdbfb3983c5bc2fa5a29b0
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2219413
> Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
> Reviewed-by: Frank Tang <ftang@chromium.org>
> Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
> Commit-Queue: Frank Tang <ftang@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#69080}

Bug: v8:6891
Change-Id: Ie3a02d8ddf6f95f0632f97b38b613b185abeb592
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2321118
Reviewed-by: Frank Tang <ftang@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69153}
2020-07-30 17:32:20 +00:00
Frank Tang
87563c3865 Fix minimumIntegerDigits in NumberFormat
The resolvedOptions of Intl.NumberFormat depends on the ICU's
skeleton. sffc change the output of the wildcard from + to *
in ICU67
(ac4540f8a4)

Change the v8 code to use * instead.

Bug: chromium:1108810
Change-Id: I8b0249a5bc4cc199f454c5070635100f68d1f48d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2318272
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69152}
2020-07-30 17:28:40 +00:00
Shu-yu Guo
5240abf3e2 Revert "[Intl] Sync Intl.Segmenter to latest version"
This reverts commit 482c3bbf1e.

Reason for revert: Test failure https://ci.chromium.org/p/v8/builders/ci/V8%20Linux%20-%20gc%20stress/29160?

Original change's description:
> [Intl] Sync Intl.Segmenter to latest version
> 
> https://tc39.es/proposal-intl-segmenter/
> 
> TC39 passed Intl.Segmenter to stage 3 in Jul 21.
> This CL move our earlier prototype to the current spec.
> 
> Bug: v8:6891
> Change-Id: I07234beed54f671c26bdbfb3983c5bc2fa5a29b0
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2219413
> Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
> Reviewed-by: Frank Tang <ftang@chromium.org>
> Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
> Commit-Queue: Frank Tang <ftang@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#69080}

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

Change-Id: I1488d5fd50012c5e8873a4fed2fa7638d86d5c6a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:6891
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2320741
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Commit-Queue: Shu-yu Guo <syg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69081}
2020-07-27 17:48:53 +00:00
Frank Tang
482c3bbf1e [Intl] Sync Intl.Segmenter to latest version
https://tc39.es/proposal-intl-segmenter/

TC39 passed Intl.Segmenter to stage 3 in Jul 21.
This CL move our earlier prototype to the current spec.

Bug: v8:6891
Change-Id: I07234beed54f671c26bdbfb3983c5bc2fa5a29b0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2219413
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: Frank Tang <ftang@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69080}
2020-07-27 17:18:17 +00:00
Frank Tang
3962a0f788 Fix crash in dateStyle and unsupported nu
Bug: chromium:1107661
Change-Id: I6c55fb74bc009d2af2ae00e34fee9e1ee709a805
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2311352
Commit-Queue: Frank Tang <ftang@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69009}
2020-07-22 17:37:53 +00:00
Frank Tang
6f356f799b [Intl] Remove flag for fractionalSecondDigits
DateTimeFormat's fractionalSecondDigits shipped in M84, so we
can drop the --harmony_intl_dateformat_fractional_second_digits
flag now.

Bug: v8:10485
Change-Id: If7a1a8599722073d7382635219a6fb46cdc47474
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2311410
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69007}
2020-07-22 16:57:43 +00:00
Frank Tang
40e34e3af4 Add "collation" option to Intl.Collator
Per change in https://github.com/tc39/ecma402/pull/459/

Bug: v8:10732
Change-Id: I2ef21e8b450cbf9c61f987c61f3ba7d6959db81a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2309149
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68976}
2020-07-21 18:32:22 +00:00
Frank Tang
be123e4057 Sync DisplayNames with latest spec
Make locales and options required
and no default for type in options.

Bug: v8:10623
Change-Id: I5df065a95e82ecb3b8b036d1b4738f296aa7243f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2291617
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68854}
2020-07-14 21:59:34 +00:00
Frank Tang
426af6c01c Sync w/ fractionalSecondDigits
Sync the implementation with the latest version of https://github.com/tc39/ecma402/pull/347

Bug: v8:10692
Change-Id: I4e2144da9f770607b4d79e7ce32f079dd2eef54c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2290627
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@{#68827}
2020-07-13 17:43:28 +00:00
Frank Tang
d3fe0e29c3 Return undefined if fractionalSecondDigits is 0
Bug: v8:10686
Change-Id: I5a7b47dd4ed10142a795de56c4739ab072e63421
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2286814
Commit-Queue: Frank Tang <ftang@chromium.org>
Reviewed-by: Frank Tang <ftang@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68773}
2020-07-09 23:01:15 +00:00
Frank Tang
81f864bfdc Use TypeError instead of RangeError
Reflect recent change to the proposal

http://tc39.es/proposal-intl-DateTimeFormat-formatRange/#sec-intl.datetimeformat.prototype.formatRange

Bug: v8:10681
Change-Id: Ie2e0e85816aeaeb2615d482ccd3ea345a5056c93
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2286813
Commit-Queue: Frank Tang <ftang@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68748}
2020-07-08 21:22:27 +00:00
Frank Tang
6680837c8a Roll icu to fix sr-ME timeZoneName in Latin bug
Bug: v8:10599
Change-Id: I1248d365576c0bc8c01d8ce07f0c49654fabfc52
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2251173
Commit-Queue: Frank Tang <ftang@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68422}
2020-06-19 06:42:51 +00:00
Frank Tang
5c7c683581 Sync DateTimeFormat with latest changes
https://tc39.es/proposal-intl-datetime-style/ (Jun 10, 2020)

fix extra s in message

Bug: v8:10613
Change-Id: I2ef4f4004c1e8f0a58bf4409578876d1553de59b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2242258
Commit-Queue: Frank Tang <ftang@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68329}
2020-06-12 19:44:42 +00:00
Frank Tang
16ffec97e5 Fix maximize/minimize of Intl.Locale
Roll ICU to 46f53dfc
chromium/src/DEPS already roll in https://chromium-review.googlesource.com/c/chromium/src/+/2235734

Bug: v8:10448
Change-Id: I147189527e57282c6cc7a1e92f832275d5ef55c6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2237353
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68275}
2020-06-10 00:01:37 +00:00
Iain Ireland
17f8f12bcb [regexp] Document incorrect assertion in intl/regress-10573.js
There are at least three equivalence classes where this assertion
should not actually hold:

  '\u0390\u1fd3',              // ΐΐ
  '\u03b0\u1fe3',              // ΰΰ
  '\ufb05\ufb06',              // ſtst

Bug: v8:10591
Change-Id: I26cb43d2e67c54e689f1831ea13be46c73d5e92d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2231595
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68246}
2020-06-09 06:27:27 +00:00
Frank Tang
f6ce085a48 Reland "Roll ICU from 65.1 to 67.1 & correct tests"
The fix is in 630b884f84 not f2223961.

This reverts commit 464ee4b7ad.

Reason for revert: roll to 67.1 after the landing of the fix

Original change's description:
> Revert "Roll ICU from 65.1 to 67.1 (f2223961) & correct tests"
>
> This reverts commit e270b6d615.
>
> Reason for revert: V8 DEPS roll stuck https://crbug.com/v8/10567#c1
>
> Original change's description:
> > Roll ICU from 65.1 to 67.1 (f2223961) & correct tests
> >
> > Rolling to chrome/src is in
> > https://chromium-review.googlesource.com/c/chromium/src/+/2155530
> >
> > Since auto rolling stop after 3/24/2020 and the rolling will cause
> > change of test status, I get this cl ready (but not running trybot due
> > to 1074260) and plan to hand roll after the submission of 2155530.
> >
> > Bug: chromium:1064326, v8:9515, v8:10379, v8:10380, v8:10437
> > Change-Id: I19554f68cfdc5b717dfc7fc4b1222e9dc25b8d69
> > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2158486
> > Auto-Submit: Frank Tang <ftang@chromium.org>
> > Commit-Queue: Michael Achenbach <machenbach@chromium.org>
> > Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
> > Reviewed-by: Michael Achenbach <machenbach@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#67493}
>
> TBR=jkummerow@chromium.org,machenbach@chromium.org,jshin@chromium.org,ftang@chromium.org,syg@chromium.org
>
> # Not skipping CQ checks because original CL landed > 1 day ago.
>
> Bug: chromium:1064326, v8:9515, v8:10379, v8:10380, v8:10437
> Change-Id: I3f4233815ed7414f2cde3d4d996696575b5f6e3a
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2219334
> Reviewed-by: Zhi An Ng <zhin@chromium.org>
> Reviewed-by: Michael Achenbach <machenbach@chromium.org>
> Commit-Queue: Zhi An Ng <zhin@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#68051}

TBR=jkummerow@chromium.org,machenbach@chromium.org,jshin@chromium.org,zhin@chromium.org,ftang@chromium.org,syg@chromium.org

# Not skipping CQ checks because this is a reland.

Bug: chromium:1064326, v8:9515, v8:10379, v8:10380, v8:10437
Change-Id: I1de5eb36eff420482a12205682b153a2493d5249
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2220781
Reviewed-by: Frank Tang <ftang@chromium.org>
Reviewed-by: Zhi An Ng <zhin@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68160}
2020-06-03 22:28:33 +00:00
Iain Ireland
b65fcfe925 [regexp] Fix non-unicode ignore-case backreferences
https://crrev.com/c/2072858 rewrote the implementation of non-unicode
ignore-case matches to comply with the JS spec in some corner
cases. It fixed character matches and character class matches.

We missed a similar bug in the implementation of back references. This
CL fixes that bug.

The main change is in regexp-macro-assembler.cc, where
CaseInsensitiveCompareUC16 is split into CaseInsensitiveCompareUnicode
(which has the same semantics as before) and
CaseInsensitiveCompareNonUnicode (which has the semantics described
here: https://tc39.es/ecma262/#sec-runtime-semantics-canonicalize-ch).

Most of the rest of the patch undoes https://crrev.com/c/2081816 to
once again make the unicode flag available to the macroassembler, so
that we can decide which helper function to call.

The testcase is a version of test/intl/regress-10248.js, modified to
test backreferences.

Bug: v8:10573
Change-Id: I70ef7d134d37f99b1f75a5eba17020e82d59f1b9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2219284
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68129}
2020-06-03 08:59:08 +00:00
Frank Tang
ba3a9424f1 [Intl] Changes of toStringTag of Intl.*
Implement the spec changes in https://github.com/tc39/ecma402/pull/430

Bug: v8:10554
Change-Id: I421d6feb94810027cf17ff58a4ec5357940ef44a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2212889
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68119}
2020-06-02 20:31:45 +00:00
Ng Zhi An
464ee4b7ad Revert "Roll ICU from 65.1 to 67.1 (f2223961) & correct tests"
This reverts commit e270b6d615.

Reason for revert: V8 DEPS roll stuck https://crbug.com/v8/10567#c1

Original change's description:
> Roll ICU from 65.1 to 67.1 (f2223961) & correct tests
> 
> Rolling to chrome/src is in
> https://chromium-review.googlesource.com/c/chromium/src/+/2155530
> 
> Since auto rolling stop after 3/24/2020 and the rolling will cause
> change of test status, I get this cl ready (but not running trybot due
> to 1074260) and plan to hand roll after the submission of 2155530.
> 
> Bug: chromium:1064326, v8:9515, v8:10379, v8:10380, v8:10437
> Change-Id: I19554f68cfdc5b717dfc7fc4b1222e9dc25b8d69
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2158486
> Auto-Submit: Frank Tang <ftang@chromium.org>
> Commit-Queue: Michael Achenbach <machenbach@chromium.org>
> Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
> Reviewed-by: Michael Achenbach <machenbach@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#67493}

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

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: chromium:1064326, v8:9515, v8:10379, v8:10380, v8:10437
Change-Id: I3f4233815ed7414f2cde3d4d996696575b5f6e3a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2219334
Reviewed-by: Zhi An Ng <zhin@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68051}
2020-05-28 16:58:07 +00:00
Frank Tang
758212a82e [Intl] Fix hour cycle in formatRange
Bug: v8:9934
Change-Id: I8e4c0bb647913b703c01fd0d11329fba254e5350
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2195491
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67760}
2020-05-12 20:38:45 +00:00
Jakob Gruber
3c422d1c5e [snapshot] Clear reconstructable data prior to d8 stress_snapshot run
The serializer currently cannot handle a heap state containing
arbitrary compiled Code objects. As a quick fix for the
--stress-snapshot d8 flag, we clear compiled data from the isolate
prior to the serialize-deserialize-verify pass.

With this change, mjsunit tests pass on x64.

The %SerializeDeserializeNow() runtime function would require more
work, since it is not possible to mutate the heap to this extent while
still preserving a runnable host context and isolate. We will need
another solution there.

Drive-by: Skip the stress_snapshot variant except for the mjsunit
suite.

Tbr: machenbach@chromium.org
Bug: v8:10493,v8:10416
Change-Id: Ie110da8b51613fcd69c7f391d3cf8589d6b04dd8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2182429
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67585}
2020-05-06 07:11:22 +00:00
Frank Tang
e270b6d615 Roll ICU from 65.1 to 67.1 (f2223961) & correct tests
Rolling to chrome/src is in
https://chromium-review.googlesource.com/c/chromium/src/+/2155530

Since auto rolling stop after 3/24/2020 and the rolling will cause
change of test status, I get this cl ready (but not running trybot due
to 1074260) and plan to hand roll after the submission of 2155530.

Bug: chromium:1064326, v8:9515, v8:10379, v8:10380, v8:10437
Change-Id: I19554f68cfdc5b717dfc7fc4b1222e9dc25b8d69
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2158486
Auto-Submit: Frank Tang <ftang@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67493}
2020-04-30 10:45:15 +00:00
Frank Tang
2a0505eda9 Roll ICU to tz2020a on top of 65.1
Somehow the auto rolling of ICU does not happen after 2020/3/24
(see https://bugs.chromium.org/p/v8/issues/detail?id=10481) so I hand roll
ICU now.

For example, the following icu hash into chrome/src/DEPS was not yet
auto rolled after ~4 weeks:
2020/4/1 https://chromium-review.googlesource.com/c/chromium/src/+/2109133
2020/4/28 https://chromium-review.googlesource.com/c/chromium/src/+/2162266

Bug: chromium:1074578
Change-Id: I7ba0d240351f7458997e66a1e580564684a8b5a2
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2173670
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67485}
2020-04-30 00:25:02 +00:00
Frank Tang
3f270f34a1 [intl] Remove flag for Intl.DisplayNames
Intl.DisplayNames was shipped in m81 and we now can remove the flag.
https://www.chromestatus.com/features/4965112605573120


Bug: v8:8703
Change-Id: Ib65d787c1871aa1da38a22fdb9e369c680c7d2c9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2163820
Commit-Queue: Frank Tang <ftang@chromium.org>
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67382}
2020-04-25 02:14:01 +00:00
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