Implement basic types for ECMAScript Internationalization API
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 30 Jul 2015 03:33:32 +0000 (03:33 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 30 Jul 2015 03:33:32 +0000 (03:33 +0000)
commit77e4cc25bdc30098e5e55eb8ed7c5981cbf75f7e
tree85d00ede93a79f04c86706657632b1a22bc900c7
parent9f0fa33b8375a238f8d87cfd006d514063d6f7e8
Implement basic types for ECMAScript Internationalization API
https://bugs.webkit.org/show_bug.cgi?id=146926

Patch by Andy VanWagoner <thetalecrafter@gmail.com> on 2015-07-29
Reviewed by Benjamin Poulain.

.:

Enable flag now that the basic objects are in place.

* Source/cmake/WebKitFeatures.cmake: enable INTL

Source/JavaScriptCore:

Adds basic types for ECMA-402 2nd edition, but does not implement the full locale-aware features yet.
http://www.ecma-international.org/ecma-402/2.0/ECMA-402.pdf

* CMakeLists.txt: Added new Intl files.
* Configurations/FeatureDefines.xcconfig: Enable INTL.
* DerivedSources.make: Added Intl files.
* JavaScriptCore.xcodeproj/project.pbxproj: Added Intl files.
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: Added Intl files.
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters: Added Intl files.
* runtime/CommonIdentifiers.h: Added Collator, NumberFormat, and DateTimeFormat.
* runtime/DateConstructor.cpp: Made Date.now public.
* runtime/DateConstructor.h: Made Date.now public.
* runtime/IntlCollator.cpp: Added.
(JSC::IntlCollator::create):
(JSC::IntlCollator::createStructure):
(JSC::IntlCollator::IntlCollator):
(JSC::IntlCollator::finishCreation):
(JSC::IntlCollator::destroy):
(JSC::IntlCollator::visitChildren):
(JSC::IntlCollator::setBoundCompare):
(JSC::IntlCollatorFuncCompare): Added placeholder implementation using codePointCompare.
* runtime/IntlCollator.h: Added.
(JSC::IntlCollator::constructor):
(JSC::IntlCollator::boundCompare):
* runtime/IntlCollatorConstructor.cpp: Added.
(JSC::IntlCollatorConstructor::create):
(JSC::IntlCollatorConstructor::createStructure):
(JSC::IntlCollatorConstructor::IntlCollatorConstructor):
(JSC::IntlCollatorConstructor::finishCreation):
(JSC::constructIntlCollator): Added Collator constructor (10.1.2).
(JSC::callIntlCollator): Added Collator constructor (10.1.2).
(JSC::IntlCollatorConstructor::getConstructData):
(JSC::IntlCollatorConstructor::getCallData):
(JSC::IntlCollatorConstructor::getOwnPropertySlot):
(JSC::IntlCollatorConstructorFuncSupportedLocalesOf): Added placeholder implementation returning [].
(JSC::IntlCollatorConstructor::visitChildren):
* runtime/IntlCollatorConstructor.h: Added.
(JSC::IntlCollatorConstructor::collatorStructure):
* runtime/IntlCollatorPrototype.cpp: Added.
(JSC::IntlCollatorPrototype::create):
(JSC::IntlCollatorPrototype::createStructure):
(JSC::IntlCollatorPrototype::IntlCollatorPrototype):
(JSC::IntlCollatorPrototype::finishCreation):
(JSC::IntlCollatorPrototype::getOwnPropertySlot):
(JSC::IntlCollatorPrototypeGetterCompare): Added compare getter (10.3.3)
(JSC::IntlCollatorPrototypeFuncResolvedOptions): Added placeholder implementation returning {}.
* runtime/IntlCollatorPrototype.h: Added.
* runtime/IntlDateTimeFormat.cpp: Added.
(JSC::IntlDateTimeFormat::create):
(JSC::IntlDateTimeFormat::createStructure):
(JSC::IntlDateTimeFormat::IntlDateTimeFormat):
(JSC::IntlDateTimeFormat::finishCreation):
(JSC::IntlDateTimeFormat::destroy):
(JSC::IntlDateTimeFormat::visitChildren):
(JSC::IntlDateTimeFormat::setBoundFormat):
(JSC::IntlDateTimeFormatFuncFormatDateTime): Added placeholder implementation returning new Date(value).toString().
* runtime/IntlDateTimeFormat.h: Added.
(JSC::IntlDateTimeFormat::constructor):
(JSC::IntlDateTimeFormat::boundFormat):
* runtime/IntlDateTimeFormatConstructor.cpp: Added.
(JSC::IntlDateTimeFormatConstructor::create):
(JSC::IntlDateTimeFormatConstructor::createStructure):
(JSC::IntlDateTimeFormatConstructor::IntlDateTimeFormatConstructor):
(JSC::IntlDateTimeFormatConstructor::finishCreation):
(JSC::constructIntlDateTimeFormat): Added DateTimeFormat constructor (12.1.2).
(JSC::callIntlDateTimeFormat): Added DateTimeFormat constructor (12.1.2).
(JSC::IntlDateTimeFormatConstructor::getConstructData):
(JSC::IntlDateTimeFormatConstructor::getCallData):
(JSC::IntlDateTimeFormatConstructor::getOwnPropertySlot):
(JSC::IntlDateTimeFormatConstructorFuncSupportedLocalesOf): Added placeholder implementation returning [].
(JSC::IntlDateTimeFormatConstructor::visitChildren):
* runtime/IntlDateTimeFormatConstructor.h: Added.
(JSC::IntlDateTimeFormatConstructor::dateTimeFormatStructure):
* runtime/IntlDateTimeFormatPrototype.cpp: Added.
(JSC::IntlDateTimeFormatPrototype::create):
(JSC::IntlDateTimeFormatPrototype::createStructure):
(JSC::IntlDateTimeFormatPrototype::IntlDateTimeFormatPrototype):
(JSC::IntlDateTimeFormatPrototype::finishCreation):
(JSC::IntlDateTimeFormatPrototype::getOwnPropertySlot):
(JSC::IntlDateTimeFormatPrototypeGetterFormat): Added format getter (12.3.3).
(JSC::IntlDateTimeFormatPrototypeFuncResolvedOptions): Added placeholder implementation returning {}.
* runtime/IntlDateTimeFormatPrototype.h: Added.
* runtime/IntlNumberFormat.cpp: Added.
(JSC::IntlNumberFormat::create):
(JSC::IntlNumberFormat::createStructure):
(JSC::IntlNumberFormat::IntlNumberFormat):
(JSC::IntlNumberFormat::finishCreation):
(JSC::IntlNumberFormat::destroy):
(JSC::IntlNumberFormat::visitChildren):
(JSC::IntlNumberFormat::setBoundFormat):
(JSC::IntlNumberFormatFuncFormatNumber): Added placeholder implementation returning Number(value).toString().
* runtime/IntlNumberFormat.h: Added.
(JSC::IntlNumberFormat::constructor):
(JSC::IntlNumberFormat::boundFormat):
* runtime/IntlNumberFormatConstructor.cpp: Added.
(JSC::IntlNumberFormatConstructor::create):
(JSC::IntlNumberFormatConstructor::createStructure):
(JSC::IntlNumberFormatConstructor::IntlNumberFormatConstructor):
(JSC::IntlNumberFormatConstructor::finishCreation):
(JSC::constructIntlNumberFormat): Added NumberFormat constructor (11.1.2).
(JSC::callIntlNumberFormat): Added NumberFormat constructor (11.1.2).
(JSC::IntlNumberFormatConstructor::getConstructData):
(JSC::IntlNumberFormatConstructor::getCallData):
(JSC::IntlNumberFormatConstructor::getOwnPropertySlot):
(JSC::IntlNumberFormatConstructorFuncSupportedLocalesOf): Added placeholder implementation returning [].
(JSC::IntlNumberFormatConstructor::visitChildren):
* runtime/IntlNumberFormatConstructor.h: Added.
(JSC::IntlNumberFormatConstructor::numberFormatStructure):
* runtime/IntlNumberFormatPrototype.cpp: Added.
(JSC::IntlNumberFormatPrototype::create):
(JSC::IntlNumberFormatPrototype::createStructure):
(JSC::IntlNumberFormatPrototype::IntlNumberFormatPrototype):
(JSC::IntlNumberFormatPrototype::finishCreation):
(JSC::IntlNumberFormatPrototype::getOwnPropertySlot):
(JSC::IntlNumberFormatPrototypeGetterFormat): Added format getter (11.3.3).
(JSC::IntlNumberFormatPrototypeFuncResolvedOptions): Added placeholder implementation returning {}.
* runtime/IntlNumberFormatPrototype.h: Added.
* runtime/IntlObject.cpp:
(JSC::IntlObject::create):
(JSC::IntlObject::finishCreation): Added Collator, NumberFormat, and DateTimeFormat properties (8.1).
(JSC::IntlObject::visitChildren):
* runtime/IntlObject.h:
(JSC::IntlObject::collatorConstructor):
(JSC::IntlObject::collatorPrototype):
(JSC::IntlObject::collatorStructure):
(JSC::IntlObject::numberFormatConstructor):
(JSC::IntlObject::numberFormatPrototype):
(JSC::IntlObject::numberFormatStructure):
(JSC::IntlObject::dateTimeFormatConstructor):
(JSC::IntlObject::dateTimeFormatPrototype):
(JSC::IntlObject::dateTimeFormatStructure):
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):

Source/WebCore:

* Configurations/FeatureDefines.xcconfig: Enabled INTL.

Source/WebKit/mac:

* Configurations/FeatureDefines.xcconfig: Enabled INTL.

Source/WebKit2:

* Configurations/FeatureDefines.xcconfig: Enabled INTL.

Tools:

Enable flag now that the basic objects are in place.

* Scripts/webkitperl/FeatureList.pm: Enabled INTL

LayoutTests:

Add tests for Intl.Collator, Intl.NumberFormat, and Intl.DateTimeFormat

* TestExpectations: Enabled intl tests.
* js/intl-collator-expected.txt: Added.
* js/intl-collator.html: Added.
* js/intl-datetimeformat-expected.txt: Added.
* js/intl-datetimeformat.html: Added.
* js/intl-expected.txt: Updated.
* js/intl-numberformat-expected.txt: Added.
* js/intl-numberformat.html: Added.
* js/script-tests/intl-collator.js: Added.
* js/script-tests/intl-datetimeformat.js: Added.
* js/script-tests/intl-numberformat.js: Added.
* js/script-tests/intl.js: Added tests for Collator, NumberFormat, and DateTimeFormat.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@187575 268f45cc-cd09-0410-ab3c-d52691b4dbfc
54 files changed:
ChangeLog
LayoutTests/ChangeLog
LayoutTests/TestExpectations
LayoutTests/js/intl-collator-expected.txt [new file with mode: 0644]
LayoutTests/js/intl-collator.html [new file with mode: 0644]
LayoutTests/js/intl-datetimeformat-expected.txt [new file with mode: 0644]
LayoutTests/js/intl-datetimeformat.html [new file with mode: 0644]
LayoutTests/js/intl-expected.txt
LayoutTests/js/intl-numberformat-expected.txt [new file with mode: 0644]
LayoutTests/js/intl-numberformat.html [new file with mode: 0644]
LayoutTests/js/script-tests/intl-collator.js [new file with mode: 0644]
LayoutTests/js/script-tests/intl-datetimeformat.js [new file with mode: 0644]
LayoutTests/js/script-tests/intl-numberformat.js [new file with mode: 0644]
LayoutTests/js/script-tests/intl.js
Source/JavaScriptCore/CMakeLists.txt
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig
Source/JavaScriptCore/DerivedSources.make
Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj
Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters
Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
Source/JavaScriptCore/runtime/CommonIdentifiers.h
Source/JavaScriptCore/runtime/DateConstructor.cpp
Source/JavaScriptCore/runtime/DateConstructor.h
Source/JavaScriptCore/runtime/IntlCollator.cpp [new file with mode: 0644]
Source/JavaScriptCore/runtime/IntlCollator.h [new file with mode: 0644]
Source/JavaScriptCore/runtime/IntlCollatorConstructor.cpp [new file with mode: 0644]
Source/JavaScriptCore/runtime/IntlCollatorConstructor.h [new file with mode: 0644]
Source/JavaScriptCore/runtime/IntlCollatorPrototype.cpp [new file with mode: 0644]
Source/JavaScriptCore/runtime/IntlCollatorPrototype.h [new file with mode: 0644]
Source/JavaScriptCore/runtime/IntlDateTimeFormat.cpp [new file with mode: 0644]
Source/JavaScriptCore/runtime/IntlDateTimeFormat.h [new file with mode: 0644]
Source/JavaScriptCore/runtime/IntlDateTimeFormatConstructor.cpp [new file with mode: 0644]
Source/JavaScriptCore/runtime/IntlDateTimeFormatConstructor.h [new file with mode: 0644]
Source/JavaScriptCore/runtime/IntlDateTimeFormatPrototype.cpp [new file with mode: 0644]
Source/JavaScriptCore/runtime/IntlDateTimeFormatPrototype.h [new file with mode: 0644]
Source/JavaScriptCore/runtime/IntlNumberFormat.cpp [new file with mode: 0644]
Source/JavaScriptCore/runtime/IntlNumberFormat.h [new file with mode: 0644]
Source/JavaScriptCore/runtime/IntlNumberFormatConstructor.cpp [new file with mode: 0644]
Source/JavaScriptCore/runtime/IntlNumberFormatConstructor.h [new file with mode: 0644]
Source/JavaScriptCore/runtime/IntlNumberFormatPrototype.cpp [new file with mode: 0644]
Source/JavaScriptCore/runtime/IntlNumberFormatPrototype.h [new file with mode: 0644]
Source/JavaScriptCore/runtime/IntlObject.cpp
Source/JavaScriptCore/runtime/IntlObject.h
Source/JavaScriptCore/runtime/JSGlobalObject.cpp
Source/WebCore/ChangeLog
Source/WebCore/Configurations/FeatureDefines.xcconfig
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/Configurations/FeatureDefines.xcconfig
Source/WebKit2/ChangeLog
Source/WebKit2/Configurations/FeatureDefines.xcconfig
Source/cmake/WebKitFeatures.cmake
Tools/ChangeLog
Tools/Scripts/webkitperl/FeatureList.pm