Commit Graph

23 Commits

Author SHA1 Message Date
Jungshik Shin
98c0cd9f8f Use the base locale when getting the best match pattern
This is to fix an assertion failure in formatToParts when
Chinese calendar is specified with 'u-ca-chinese'.

See https://github.com/tc39/ecma402/issues/225 . This CL
is a temporary work-around to get v8 match the spec in terms
of the external behavior, but it's not taking the steps in
the spec, yet.

Moreover, the spec may have to be revised as to how to pick the best
match pattern when the default calendar for a locale is different from
the calendar specified via 'u-ca'. How to handle 'related year' part
also needs to be specified.

Bug: chromium:826549
Test: intl/date-format/format-with-extensions
Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng
Change-Id: I1f9a2467e86e71e024bc9babe18f16e49746008e
Reviewed-on: https://chromium-review.googlesource.com/1006915
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Jungshik Shin <jshin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52556}
2018-04-12 06:14:47 +00:00
Jungshik Shin
6ecd970226 Add a test for a huge time value and month display
Bug: chromium:801602
Test: intl/date-format/month-far-future.js
Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng
Change-Id: Ie2279680e8879c943cbf0873a933d2633e759212
Reviewed-on: https://chromium-review.googlesource.com/868376
Reviewed-by: Adam Klein <adamk@chromium.org>
Commit-Queue: Jungshik Shin <jshin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50914}
2018-01-27 10:52:46 +00:00
Jungshik Shin
831bc23303 Intl.DateTimeFormat: throw RangeError for non-finite input
intl.js throws an exception when datetime-value to format is
Infinity or NaN, but there was a way to thwart the check.

Moreover, intl.js and runtime-intl.cc have unnecessary conversions
of 'Number->Date->Number'. I removed the unnecessary conversion
and made 'Number' be passed to %InternalDateFormat.  With this
streamlining, the work-around mentioned above does not work
anymore.

Add a check in runtime_intl.cc for Infinity/NaN and throw a
RangeError.

Add invalid-time test for invalid datetime-values passed to
Intl.DateTimeFormat.format().

Bug: chromium:774833
Test: intl/date-format/invalid-time.js
Cq-Include-Trybots: master.tryserver.v8:v8_linux_noi18n_rel_ng
Change-Id: Idc575e532a86ee110dc4bb945ae023d6516650ee
Reviewed-on: https://chromium-review.googlesource.com/724860
Commit-Queue: Jungshik Shin <jshin@chromium.org>
Reviewed-by: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48765}
2017-10-19 23:25:52 +00:00
Daniel Ehrenberg
8345cd3e09 [tests] Fix timezone dependence in an intl test
In certain timezones, being at noon UTC doesn't guarantee that
you'll be the same day in local time. This patch fixes that
false assumption. Thanks to Holmes He for reporting the issue.

Cq-Include-Trybots: master.tryserver.v8:v8_linux_noi18n_rel_ng
Change-Id: I7432c0eb1e13fdf11c665e59dabaebeb79bff8c8
Reviewed-on: https://chromium-review.googlesource.com/568021
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Daniel Ehrenberg <littledan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46584}
2017-07-12 12:23:22 +00:00
Adam Klein
2733087279 [intl] Remove always-true --datetime-format-to-parts flag
This flag was shipped with V8 5.7 (Chrome 57).

Bug: v8:5244
Change-Id: I044edb8d7e74ea3c84bf46ec5cf81b8ff1b7a3de
Reviewed-on: https://chromium-review.googlesource.com/477975
Reviewed-by: Daniel Ehrenberg <littledan@chromium.org>
Commit-Queue: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#44667}
2017-04-17 19:25:51 +00:00
littledan
48a36c7df7 [intl] Avoid modifying options bag from constructor
Previously, the Intl.DateTimeFormat constructor and other related paths had
a bug where the options bag passed in would be modified in place. This patch
makes V8's Intl implementation follow the specification's logic to avoid
such a modification.

BUG=v8:4219

Review-Url: https://codereview.chromium.org/2587703002
Cr-Commit-Position: refs/heads/master@{#41826}
2016-12-19 21:36:16 +00:00
littledan
915ca181cc Remove --intl-extra flag
This flag has been flipped off since 52, so it is due for removal.

R=adamk@chromium.org,caitp@igalia.com
BUG=v8:3785
CQ_INCLUDE_TRYBOTS=master.tryserver.v8:v8_linux_noi18n_rel_ng

Review-Url: https://codereview.chromium.org/2268633002
Cr-Commit-Position: refs/heads/master@{#39435}
2016-09-15 02:55:33 +00:00
jshin
a3db819c9e Add support for DateTimeFormat.formatToParts
Spec discussion:  https://github.com/tc39/ecma402/issues/30

It's in stage 4 and Firefox has already implemented it.

For now, it's added to HARMONY_IN_PROGRESS bucket behind
'--datetime-format-to-parts' flag.

BUG=v8:5244
TEST=intl/date-format/date-format-to-parts.js
TEST=test262/intl402/DateTimeFormat/prototype/formatToParts/*

Review-Url: https://codereview.chromium.org/2273953003
Cr-Commit-Position: refs/heads/master@{#39225}
2016-09-06 22:57:11 +00:00
jshin
339f08d2e9 Support language tag extensions with multiple subtags for a key
Language tags with Unicode extensions can have multiple subtags
for a key (e.g. -ca-ismalic-civil has 'islamic-civi' for 'ca').

BUG=v8:4749
TEST=intl/date-format/calendar-with-multiple-type-subtags.js

Review-Url: https://codereview.chromium.org/2248563003
Cr-Commit-Position: refs/heads/master@{#38692}
2016-08-17 17:55:34 +00:00
jshin
72d86e3772 Fix Intl*parsing tests and test status
intl/number-format/parse-percent.js
intl/date-format/parse-mdyhms.js
intl/number-format/parse-decimal.js
intl/date-format/parse-MMMdy.js

Also added a few more test cases.

BUG=v8:3454
TEST=The tests listed above.

Review-Url: https://codereview.chromium.org/1988073003
Cr-Commit-Position: refs/heads/master@{#36555}
2016-05-27 17:59:19 +00:00
littledan
0bd50885e8 Remove certain non-standard properties from Intl
This patch removes the following properties, as their use count is
very low, they are V8-only, and not on a standards track.
- v8Parse
- resolved
- pattern

v8BreakIterator is left in as it has significantly more usage.

BUG=v8:3785
R=adamk,jshin@chromium.org

Review-Url: https://codereview.chromium.org/1968893002
Cr-Commit-Position: refs/heads/master@{#36190}
2016-05-12 00:34:48 +00:00
littledan
5aa5258e51 Enable some passing, disabled Intl tests
A couple of the Intl tests made calls to getDefaultTimeZone(), which
doesn't exist in V8; however, these were not core to the test. Rather
than marking the whole test as failing, just comment out that
unimportant part of the test.

R=adamk

Review URL: https://codereview.chromium.org/1522533003

Cr-Commit-Position: refs/heads/master@{#32819}
2015-12-12 01:33:52 +00:00
littledan
d67756a775 Set the Gregorian changeover date to the beginning of time in Intl
ECMAScript dates act as if the Gregorian changeover happened at the
beginning of time. This patch fixes up internationalized date
formatting to set that changeover properly, as opposed to the ICU
default which is in the 16th century.

BUG=chromium:537382
R=adamk,cira
LOG=Y

Review URL: https://codereview.chromium.org/1501113002

Cr-Commit-Position: refs/heads/master@{#32669}
2015-12-08 02:13:54 +00:00
jochen@chromium.org
08be29d8bd Revert r22544: "Rebaseline/update the intl tests with ICU 52"
The intl tests still fail locally.

BUG=v8:3454
LOG=N
R=verwaest@chromium.org

Review URL: https://codereview.chromium.org/410083004

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@22558 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-07-23 11:39:46 +00:00
jochen@chromium.org
3651a67156 Rebaseline/update the intl tests with ICU 52
Update the following 4 intl tests after ICU 52 roll.

date-format/parse-MMMdy.js
date-format/parse-mdyhms.js
number-format/parse-decimal.js
number-format/parse-percent.js

BUG=v8:3454
TEST=intl/* tests pass.
LOG=Y
R=jochen@chromium.org

Review URL: https://codereview.chromium.org/410733003

Patch from Jungshik Shin <jshin@chromium.org>.

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@22544 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-07-23 09:00:43 +00:00
jochen@chromium.org
f30452ba40 Store i18n meta data in hidden symbols instead of js accessible properties
There were some tests that are supposed to protect against js messing
with the meta data, however, they just didn't try hard enough.

BUG=354967
R=dcarney@chromium.org
LOG=y

Committed: https://code.google.com/p/v8/source/detail?r=20375

Review URL: https://codereview.chromium.org/215293005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20388 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-04-01 10:56:16 +00:00
machenbach@chromium.org
8806f2d815 Revert r20375.
Store i18n meta data in hidden symbols instead of js accessible properties

BUG=354967
LOG=N
TBR=jochen@chromium.org

Review URL: https://codereview.chromium.org/220673002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20377 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-04-01 08:05:45 +00:00
jochen@chromium.org
0d04cba759 Store i18n meta data in hidden symbols instead of js accessible properties
There were some tests that are supposed to protect against js messing
with the meta data, however, they just didn't try hard enough.

BUG=354967
R=dcarney@chromium.org
LOG=y

Review URL: https://codereview.chromium.org/215293005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20375 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-04-01 07:21:05 +00:00
cira@chromium.org
c0ff0b284d Original review https://codereview.chromium.org/25855005.
Reverting reverted r17148 and fixing build (test) breakage by side stepping the Windows vs. Linux issue of different Date object for the same millisecond time stamp.
We do that by using UTC Date methods (they eliminate DST problems).

Windows:
new Date(129193200000);
Sun Feb 03 1974 23:00:00 GMT-0800 (Pacific Standard Time)

Linux:
new Date(129193200000);
Mon Feb 04 1974 00:00:00 GMT-0700 (PST)

BUG=2919
R=dslomov@chromium.org, mnita@google.com

Review URL: https://codereview.chromium.org/26918002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@17171 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-10-11 17:54:31 +00:00
dslomov@chromium.org
0610773db7 Revert "Fixing timezone issues with date-time/parse-* tests."
This reverts commit r17148 for breaking tests on Windows.

TBR=cira@google.com,titzer@chromium.org

Review URL: https://codereview.chromium.org/26467005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@17149 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-10-10 19:43:05 +00:00
cira@chromium.org
2986f94c14 Fixing timezone issues with date-time/parse-* tests.
BUG=2919
TEST=All tests passing when local timezone was set to EST.
R=mnita@google.com, titzer@chromium.org

Review URL: https://codereview.chromium.org/25855005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@17148 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-10-10 17:54:33 +00:00
jochen@chromium.org
777bae581a Reenable tests that need to access the default timezone.
It's now available via builtins.

BUG=v8:2475
R=mstarzinger@chromium.org

Review URL: https://codereview.chromium.org/21512002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16016 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-08-01 19:43:06 +00:00
jochen@chromium.org
c61c74d24f Import intl test suite from v8-i18n project
BUG=v8:2745
R=jkummerow@chromium.org

Review URL: https://codereview.chromium.org/18687003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15584 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-07-10 10:49:04 +00:00