[INTL] Implement Date.prototype.toLocaleString in ECMA-402
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 15 Jan 2016 19:30:45 +0000 (19:30 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 15 Jan 2016 19:30:45 +0000 (19:30 +0000)
commitae58194d81b059da79f9cc11baca0820e752b511
treeed3145c584c33a8a35acf74c4f8f2a7bf6bc91b4
parent169dab648578669aab1281e6325e708f82216d04
[INTL] Implement Date.prototype.toLocaleString in ECMA-402
https://bugs.webkit.org/show_bug.cgi?id=147611

Patch by Andy VanWagoner <thetalecrafter@gmail.com> on 2016-01-15
Reviewed by Benjamin Poulain.

Source/JavaScriptCore:

Expose dateProtoFuncGetTime as thisTimeValue for builtins.
Remove unused code in DateTimeFormat toDateTimeOptions, and make the
function specific to the call in initializeDateTimeFormat. Properly
throw when the options parameter is null.
Add toLocaleString in builtin JavaScript, with it's own specific branch
of toDateTimeOptions.

* CMakeLists.txt:
* DerivedSources.make:
* JavaScriptCore.xcodeproj/project.pbxproj:
* builtins/DatePrototype.js: Added.
(toLocaleString.toDateTimeOptionsAnyAll):
(toLocaleString):
* runtime/CommonIdentifiers.h:
* runtime/DatePrototype.cpp:
(JSC::DatePrototype::finishCreation):
* runtime/DatePrototype.h:
* runtime/IntlDateTimeFormat.cpp:
(JSC::toDateTimeOptionsAnyDate):
(JSC::IntlDateTimeFormat::initializeDateTimeFormat):
(JSC::toDateTimeOptions): Deleted.
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):

LayoutTests:

* js/intl-datetimeformat-expected.txt: Added test for null options.
* js/date-toLocaleString-expected.txt: Added.
* js/date-toLocaleString.html: Added.
* js/script-tests/intl-datetimeformat.js: Added test for null options.
* js/script-tests/date-toLocaleString.js: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@195138 268f45cc-cd09-0410-ab3c-d52691b4dbfc
16 files changed:
LayoutTests/ChangeLog
LayoutTests/js/date-toLocaleString-expected.txt [new file with mode: 0644]
LayoutTests/js/date-toLocaleString.html [new file with mode: 0644]
LayoutTests/js/intl-datetimeformat-expected.txt
LayoutTests/js/script-tests/date-toLocaleString.js [new file with mode: 0644]
LayoutTests/js/script-tests/intl-datetimeformat.js
Source/JavaScriptCore/CMakeLists.txt
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/DerivedSources.make
Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
Source/JavaScriptCore/builtins/DatePrototype.js [new file with mode: 0644]
Source/JavaScriptCore/runtime/CommonIdentifiers.h
Source/JavaScriptCore/runtime/DatePrototype.cpp
Source/JavaScriptCore/runtime/DatePrototype.h
Source/JavaScriptCore/runtime/IntlDateTimeFormat.cpp
Source/JavaScriptCore/runtime/JSGlobalObject.cpp