DateConversion::formatDateTime incorrectly formats negative years
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 15 Aug 2019 19:31:13 +0000 (19:31 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 15 Aug 2019 19:31:13 +0000 (19:31 +0000)
commit0cfa226f9976e5f59b5be33241fe69bd3ea01d01
tree23bc8094f10a55e301d15a42176fd5939bedeb91
parentdc18a4506d3b6ab717fd9c383b780cf798e3a541
DateConversion::formatDateTime incorrectly formats negative years
https://bugs.webkit.org/show_bug.cgi?id=199964

Patch by Alexey Shvayka <shvaikalesh@gmail.com> on 2019-08-15
Reviewed by Ross Kirsling.

JSTests:

* test262/expectations.yaml: Mark 6 test cases as passing.

Source/JavaScriptCore:

Currently, year is always padded to max length of 4, including the minus sign "-".
With this change, only absolute value of year is padded to max length of 4 and
preceded by minus sign "-" if the year is negative.
(steps 6-10 of https://tc39.es/ecma262/#sec-datestring)

* runtime/DateConversion.cpp:
(JSC::appendNumber):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@248738 268f45cc-cd09-0410-ab3c-d52691b4dbfc
JSTests/ChangeLog
JSTests/test262/expectations.yaml
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/runtime/DateConversion.cpp