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)
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

index cd01c3d..6c51dcb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2015-07-29  Andy VanWagoner  <thetalecrafter@gmail.com>
+
+        Implement basic types for ECMAScript Internationalization API
+        https://bugs.webkit.org/show_bug.cgi?id=146926
+
+        Reviewed by Benjamin Poulain.
+
+        Enable flag now that the basic objects are in place.
+
+        * Source/cmake/WebKitFeatures.cmake: enable INTL
+
 2015-07-29  Basile Clement  <basile_clement@apple.com>
 
         Remove native call inlining
index 671d568..bdd09a0 100644 (file)
@@ -1,3 +1,25 @@
+2015-07-29  Andy VanWagoner  <thetalecrafter@gmail.com>
+
+        Implement basic types for ECMAScript Internationalization API
+        https://bugs.webkit.org/show_bug.cgi?id=146926
+
+        Reviewed by Benjamin Poulain.
+
+        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.
+
 2015-07-29  Zalan Bujtas  <zalan@apple.com>
 
         Remove the spanner placeholder from m_spannerMap when the placeholder object
index a9c73e9..1852de1 100644 (file)
@@ -530,6 +530,3 @@ webkit.org/b/146182 editing/selection/leak-document-with-selection-inside.html [
 
 webkit.org/b/146434 fast/dom/HTMLImageElement/sizes [ Skip ]
 
-# Intl is not enabled yet
-js/intl.html [ Skip ]
-
diff --git a/LayoutTests/js/intl-collator-expected.txt b/LayoutTests/js/intl-collator-expected.txt
new file mode 100644 (file)
index 0000000..face499
--- /dev/null
@@ -0,0 +1,47 @@
+This test checks the behavior of Intl.Collator as described in the ECMAScript Internationalization API Specification (ECMA-402 2.0).
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS Intl.Collator is an instance of Function
+PASS Intl.Collator() is an instance of Intl.Collator
+PASS Intl.Collator.call({}) is an instance of Intl.Collator
+PASS new Intl.Collator() is an instance of Intl.Collator
+PASS new DerivedCollator is an instance of DerivedCollator
+PASS new DerivedCollator is an instance of Intl.Collator
+PASS new DerivedCollator().compare('a', 'b') is -1
+PASS Object.getPrototypeOf(new DerivedCollator) is DerivedCollator.prototype
+PASS Object.getPrototypeOf(Object.getPrototypeOf(new DerivedCollator)) is Intl.Collator.prototype
+PASS Intl.Collator.length is 0
+PASS Object.getOwnPropertyDescriptor(Intl.Collator, 'prototype').writable is false
+PASS Object.getOwnPropertyDescriptor(Intl.Collator, 'prototype').enumerable is false
+PASS Object.getOwnPropertyDescriptor(Intl.Collator, 'prototype').configurable is false
+PASS Intl.Collator.supportedLocalesOf.length is 1
+PASS Intl.Collator.supportedLocalesOf() is an instance of Array
+PASS Intl.Collator.prototype.constructor is Intl.Collator
+PASS Intl.Collator.prototype.compare is an instance of Function
+PASS Object.getOwnPropertyDescriptor(Intl.Collator.prototype, 'compare').get is an instance of Function
+PASS Object.getOwnPropertyDescriptor(Intl.Collator.prototype, 'compare').set is undefined
+PASS Object.getOwnPropertyDescriptor(Intl.Collator.prototype, 'compare').enumerable is false
+PASS Object.getOwnPropertyDescriptor(Intl.Collator.prototype, 'compare').configurable is true
+PASS Intl.Collator.prototype.compare.length is 2
+PASS Object.defineProperty({}, 'compare', Object.getOwnPropertyDescriptor(Intl.Collator.prototype, 'compare')).compare threw exception TypeError: Intl.Collator.prototype.compare called on value that's not an object initialized as a Collator.
+PASS Intl.Collator.prototype.compare !== Intl.Collator().compare is true
+PASS new Intl.Collator().compare !== new Intl.Collator().compare is true
+PASS Intl.Collator.prototype.compare({ toString() { throw Error('6') } }, { toString() { ++badCalls; return ''; } }) threw exception Error: 6.
+PASS badCalls is 0
+PASS Intl.Collator.prototype.compare('a', { toString() { throw Error('8') } }) threw exception Error: 8.
+PASS Intl.Collator.prototype.compare.call(null, 'a', 'b') is -1
+PASS Intl.Collator.prototype.compare.call(Intl.Collator('en', { sensitivity:'base' }), 'A', 'a') is -1
+PASS Intl.Collator.prototype.compare.call(5, 'a', 'b') is -1
+PASS new Intl.Collator().compare.call(null, 'a', 'b') is -1
+PASS new Intl.Collator().compare.call(Intl.Collator('en', { sensitivity:'base' }), 'A', 'a') is -1
+PASS new Intl.Collator().compare.call(5, 'a', 'b') is -1
+PASS Intl.Collator.prototype.resolvedOptions.length is 0
+PASS Intl.Collator.prototype.resolvedOptions() is an instance of Object
+PASS Intl.Collator.prototype.resolvedOptions() === Intl.Collator.prototype.resolvedOptions() is false
+PASS Intl.Collator.prototype.resolvedOptions.call(5) threw exception TypeError: Intl.Collator.prototype.resolvedOptions called on value that's not an object initialized as a Collator.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/js/intl-collator.html b/LayoutTests/js/intl-collator.html
new file mode 100644 (file)
index 0000000..0e6c87d
--- /dev/null
@@ -0,0 +1,10 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src="../resources/js-test-pre.js"></script>
+</head>
+<body>
+<script src="script-tests/intl-collator.js"></script>
+<script src="../resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/js/intl-datetimeformat-expected.txt b/LayoutTests/js/intl-datetimeformat-expected.txt
new file mode 100644 (file)
index 0000000..29776f5
--- /dev/null
@@ -0,0 +1,46 @@
+This test checks the behavior of Intl.DateTimeFormat as described in the ECMAScript Internationalization API Specification (ECMA-402 2.0).
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS Intl.DateTimeFormat is an instance of Function
+PASS Intl.DateTimeFormat() is an instance of Intl.DateTimeFormat
+PASS Intl.DateTimeFormat.call({}) is an instance of Intl.DateTimeFormat
+PASS new Intl.DateTimeFormat() is an instance of Intl.DateTimeFormat
+PASS new DerivedDateTimeFormat is an instance of DerivedDateTimeFormat
+PASS new DerivedDateTimeFormat is an instance of Intl.DateTimeFormat
+PASS new DerivedDateTimeFormat().format(0).length > 0 is true
+PASS Object.getPrototypeOf(new DerivedDateTimeFormat) is DerivedDateTimeFormat.prototype
+PASS Object.getPrototypeOf(Object.getPrototypeOf(new DerivedDateTimeFormat)) is Intl.DateTimeFormat.prototype
+PASS Intl.DateTimeFormat.length is 0
+PASS Object.getOwnPropertyDescriptor(Intl.DateTimeFormat, 'prototype').writable is false
+PASS Object.getOwnPropertyDescriptor(Intl.DateTimeFormat, 'prototype').enumerable is false
+PASS Object.getOwnPropertyDescriptor(Intl.DateTimeFormat, 'prototype').configurable is false
+PASS Intl.DateTimeFormat.supportedLocalesOf.length is 1
+PASS Intl.DateTimeFormat.supportedLocalesOf() is an instance of Array
+PASS Intl.DateTimeFormat.prototype.constructor is Intl.DateTimeFormat
+PASS Intl.DateTimeFormat.prototype.format is an instance of Function
+PASS Object.getOwnPropertyDescriptor(Intl.DateTimeFormat.prototype, 'format').get is an instance of Function
+PASS Object.getOwnPropertyDescriptor(Intl.DateTimeFormat.prototype, 'format').set is undefined
+PASS Object.getOwnPropertyDescriptor(Intl.DateTimeFormat.prototype, 'format').enumerable is false
+PASS Object.getOwnPropertyDescriptor(Intl.DateTimeFormat.prototype, 'format').configurable is true
+PASS Intl.DateTimeFormat.prototype.format.length is 1
+PASS Object.defineProperty({}, 'format', Object.getOwnPropertyDescriptor(Intl.DateTimeFormat.prototype, 'format')).format threw exception TypeError: Intl.DateTimeFormat.prototype.format called on value that's not an object initialized as a DateTimeFormat.
+PASS Intl.DateTimeFormat.prototype.format !== Intl.DateTimeFormat().format is true
+PASS new Intl.DateTimeFormat().format !== new Intl.DateTimeFormat().format is true
+PASS Intl.DateTimeFormat.prototype.format({ valueOf() { throw Error('4b') } }) threw exception Error: 4b.
+PASS Intl.DateTimeFormat.prototype.format(Infinity) threw exception RangeError: date value is not finite in DateTimeFormat.format().
+PASS Intl.DateTimeFormat.prototype.format.call(null, 0) is Intl.DateTimeFormat().format(0)
+PASS Intl.DateTimeFormat.prototype.format.call(Intl.DateTimeFormat('ar'), 0) is Intl.DateTimeFormat().format(0)
+PASS Intl.DateTimeFormat.prototype.format.call(5, 0) is Intl.DateTimeFormat().format(0)
+PASS new Intl.DateTimeFormat().format.call(null, 0) is Intl.DateTimeFormat().format(0)
+PASS new Intl.DateTimeFormat().format.call(Intl.DateTimeFormat('ar'), 0) is Intl.DateTimeFormat().format(0)
+PASS new Intl.DateTimeFormat().format.call(5, 0) is Intl.DateTimeFormat().format(0)
+PASS Intl.DateTimeFormat.prototype.resolvedOptions.length is 0
+PASS Intl.DateTimeFormat.prototype.resolvedOptions() is an instance of Object
+PASS Intl.DateTimeFormat.prototype.resolvedOptions() === Intl.DateTimeFormat.prototype.resolvedOptions() is false
+PASS Intl.DateTimeFormat.prototype.resolvedOptions.call(5) threw exception TypeError: Intl.DateTimeFormat.prototype.resolvedOptions called on value that's not an object initialized as a DateTimeFormat.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/js/intl-datetimeformat.html b/LayoutTests/js/intl-datetimeformat.html
new file mode 100644 (file)
index 0000000..2a58fcf
--- /dev/null
@@ -0,0 +1,10 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src="../resources/js-test-pre.js"></script>
+</head>
+<body>
+<script src="script-tests/intl-datetimeformat.js"></script>
+<script src="../resources/js-test-post.js"></script>
+</body>
+</html>
index b26af86..ac4b044 100644 (file)
@@ -1,4 +1,4 @@
-This test checks the behavior of the Intl object as described in 8 of the ECMAScript Internationalization API Specification.
+This test checks the behavior of the Intl object as described in the ECMAScript Internationalization API Specification (ECMA-402 2.0).
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
@@ -9,6 +9,7 @@ PASS Object.prototype.toString.call(Intl) is '[object Object]'
 PASS Object.getPrototypeOf(Intl) === Object.prototype is true
 PASS new Intl threw exception TypeError: Object is not a constructor (evaluating 'new Intl').
 PASS Intl() threw exception TypeError: Intl is not a function. (In 'Intl()', 'Intl' is an instance of Object).
+PASS Object.keys(Intl).length is 0
 PASS delete Intl; is true
 PASS 'Intl' in global() is false
 PASS successfullyParsed is true
diff --git a/LayoutTests/js/intl-numberformat-expected.txt b/LayoutTests/js/intl-numberformat-expected.txt
new file mode 100644 (file)
index 0000000..46de012
--- /dev/null
@@ -0,0 +1,45 @@
+This test checks the behavior of Intl.NumberFormat as described in the ECMAScript Internationalization API Specification (ECMA-402 2.0).
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS Intl.NumberFormat is an instance of Function
+PASS Intl.NumberFormat() is an instance of Intl.NumberFormat
+PASS Intl.NumberFormat.call({}) is an instance of Intl.NumberFormat
+PASS new Intl.NumberFormat() is an instance of Intl.NumberFormat
+PASS new DerivedNumberFormat is an instance of DerivedNumberFormat
+PASS new DerivedNumberFormat is an instance of Intl.NumberFormat
+PASS new DerivedNumberFormat().format(1) is '1'
+PASS Object.getPrototypeOf(new DerivedNumberFormat) is DerivedNumberFormat.prototype
+PASS Object.getPrototypeOf(Object.getPrototypeOf(new DerivedNumberFormat)) is Intl.NumberFormat.prototype
+PASS Intl.NumberFormat.length is 0
+PASS Object.getOwnPropertyDescriptor(Intl.NumberFormat, 'prototype').writable is false
+PASS Object.getOwnPropertyDescriptor(Intl.NumberFormat, 'prototype').enumerable is false
+PASS Object.getOwnPropertyDescriptor(Intl.NumberFormat, 'prototype').configurable is false
+PASS Intl.NumberFormat.supportedLocalesOf.length is 1
+PASS Intl.NumberFormat.supportedLocalesOf() is an instance of Array
+PASS Intl.NumberFormat.prototype.constructor is Intl.NumberFormat
+PASS Intl.NumberFormat.prototype.format is an instance of Function
+PASS Object.getOwnPropertyDescriptor(Intl.NumberFormat.prototype, 'format').get is an instance of Function
+PASS Object.getOwnPropertyDescriptor(Intl.NumberFormat.prototype, 'format').set is undefined
+PASS Object.getOwnPropertyDescriptor(Intl.NumberFormat.prototype, 'format').enumerable is false
+PASS Object.getOwnPropertyDescriptor(Intl.NumberFormat.prototype, 'format').configurable is true
+PASS Intl.NumberFormat.prototype.format.length is 1
+PASS Object.defineProperty({}, 'format', Object.getOwnPropertyDescriptor(Intl.NumberFormat.prototype, 'format')).format threw exception TypeError: Intl.NumberFormat.prototype.format called on value that's not an object initialized as a NumberFormat.
+PASS Intl.NumberFormat.prototype.format !== Intl.NumberFormat().format is true
+PASS new Intl.NumberFormat().format !== new Intl.NumberFormat().format is true
+PASS Intl.NumberFormat.prototype.format({ valueOf() { throw Error('5') } }) threw exception Error: 5.
+PASS Intl.NumberFormat.prototype.format.call(null, 1.2) is Intl.NumberFormat().format(1.2)
+PASS Intl.NumberFormat.prototype.format.call(Intl.DateTimeFormat('ar'), 1.2) is Intl.NumberFormat().format(1.2)
+PASS Intl.NumberFormat.prototype.format.call(5, 1.2) is Intl.NumberFormat().format(1.2)
+PASS new Intl.NumberFormat().format.call(null, 1.2) is Intl.NumberFormat().format(1.2)
+PASS new Intl.NumberFormat().format.call(Intl.DateTimeFormat('ar'), 1.2) is Intl.NumberFormat().format(1.2)
+PASS new Intl.NumberFormat().format.call(5, 1.2) is Intl.NumberFormat().format(1.2)
+PASS Intl.NumberFormat.prototype.resolvedOptions.length is 0
+PASS Intl.NumberFormat.prototype.resolvedOptions() is an instance of Object
+PASS Intl.NumberFormat.prototype.resolvedOptions() === Intl.NumberFormat.prototype.resolvedOptions() is false
+PASS Intl.NumberFormat.prototype.resolvedOptions.call(5) threw exception TypeError: Intl.NumberFormat.prototype.resolvedOptions called on value that's not an object initialized as a NumberFormat.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/js/intl-numberformat.html b/LayoutTests/js/intl-numberformat.html
new file mode 100644 (file)
index 0000000..938e20f
--- /dev/null
@@ -0,0 +1,10 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src="../resources/js-test-pre.js"></script>
+</head>
+<body>
+<script src="script-tests/intl-numberformat.js"></script>
+<script src="../resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/js/script-tests/intl-collator.js b/LayoutTests/js/script-tests/intl-collator.js
new file mode 100644 (file)
index 0000000..bc63bd6
--- /dev/null
@@ -0,0 +1,109 @@
+description("This test checks the behavior of Intl.Collator as described in the ECMAScript Internationalization API Specification (ECMA-402 2.0).");
+
+// 10.1 The Intl.Collator Constructor
+
+// The Intl.Collator constructor is a standard built-in property of the Intl object.
+shouldBeType("Intl.Collator", "Function");
+
+// 10.1.2 Intl.Collator([ locales [, options]])
+shouldBeType("Intl.Collator()", "Intl.Collator");
+shouldBeType("Intl.Collator.call({})", "Intl.Collator");
+shouldBeType("new Intl.Collator()", "Intl.Collator");
+
+// Subclassable
+class DerivedCollator extends Intl.Collator {}
+shouldBeType("new DerivedCollator", "DerivedCollator");
+shouldBeType("new DerivedCollator", "Intl.Collator");
+shouldBe("new DerivedCollator().compare('a', 'b')", "-1");
+shouldBe("Object.getPrototypeOf(new DerivedCollator)", "DerivedCollator.prototype");
+shouldBe("Object.getPrototypeOf(Object.getPrototypeOf(new DerivedCollator))", "Intl.Collator.prototype");
+
+// 10.2 Properties of the Intl.Collator Constructor
+
+// length property (whose value is 0)
+shouldBe("Intl.Collator.length", "0");
+
+// 10.2.1 Intl.Collator.prototype
+
+// This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
+shouldBeFalse("Object.getOwnPropertyDescriptor(Intl.Collator, 'prototype').writable");
+shouldBeFalse("Object.getOwnPropertyDescriptor(Intl.Collator, 'prototype').enumerable");
+shouldBeFalse("Object.getOwnPropertyDescriptor(Intl.Collator, 'prototype').configurable");
+
+// 10.2.2 Intl.Collator.supportedLocalesOf (locales [, options ])
+
+// The value of the length property of the supportedLocalesOf method is 1.
+shouldBe("Intl.Collator.supportedLocalesOf.length", "1");
+
+// Returns SupportedLocales
+shouldBeType("Intl.Collator.supportedLocalesOf()", "Array");
+
+// 10.3 Properties of the Intl.Collator Prototype Object
+
+// The value of Intl.Collator.prototype.constructor is %Collator%.
+shouldBe("Intl.Collator.prototype.constructor", "Intl.Collator");
+
+// 10.3.3 Intl.Collator.prototype.compare
+
+// This named accessor property returns a function that compares two strings according to the sort order of this Collator object.
+shouldBeType("Intl.Collator.prototype.compare", "Function");
+
+// The value of the [[Get]] attribute is a function
+shouldBeType("Object.getOwnPropertyDescriptor(Intl.Collator.prototype, 'compare').get", "Function");
+
+// The value of the [[Set]] attribute is undefined.
+shouldBe("Object.getOwnPropertyDescriptor(Intl.Collator.prototype, 'compare').set", "undefined");
+
+// Match Firefox where unspecifed.
+shouldBeFalse("Object.getOwnPropertyDescriptor(Intl.Collator.prototype, 'compare').enumerable");
+shouldBeTrue("Object.getOwnPropertyDescriptor(Intl.Collator.prototype, 'compare').configurable");
+
+// The value of F’s length property is 2.
+shouldBe("Intl.Collator.prototype.compare.length", "2");
+
+// Throws on non-Collator this.
+shouldThrow("Object.defineProperty({}, 'compare', Object.getOwnPropertyDescriptor(Intl.Collator.prototype, 'compare')).compare", "'TypeError: Intl.Collator.prototype.compare called on value that\\'s not an object initialized as a Collator'");
+
+// The compare function is unique per instance.
+shouldBeTrue("Intl.Collator.prototype.compare !== Intl.Collator().compare");
+shouldBeTrue("new Intl.Collator().compare !== new Intl.Collator().compare");
+
+// 10.3.4 Collator Compare Functions
+
+// 1. Let collator be the this value.
+// 2. Assert: Type(collator) is Object and collator has an [[initializedCollator]] internal slot whose value is true.
+// This should not be reachable, since compare is bound to an initialized collator.
+
+// 3. If x is not provided, let x be undefined.
+// 4. If y is not provided, let y be undefined.
+// 5. Let X be ToString(x).
+// 6. ReturnIfAbrupt(X).
+var badCalls = 0;
+shouldThrow("Intl.Collator.prototype.compare({ toString() { throw Error('6') } }, { toString() { ++badCalls; return ''; } })", "'Error: 6'");
+shouldBe("badCalls", "0");
+
+// 7. Let Y be ToString(y).
+// 8. ReturnIfAbrupt(Y).
+shouldThrow("Intl.Collator.prototype.compare('a', { toString() { throw Error('8') } })", "'Error: 8'");
+
+// Compare is bound, so calling with alternate "this" has no effect.
+shouldBe("Intl.Collator.prototype.compare.call(null, 'a', 'b')", "-1");
+shouldBe("Intl.Collator.prototype.compare.call(Intl.Collator('en', { sensitivity:'base' }), 'A', 'a')", "-1");
+shouldBe("Intl.Collator.prototype.compare.call(5, 'a', 'b')", "-1");
+shouldBe("new Intl.Collator().compare.call(null, 'a', 'b')", "-1");
+shouldBe("new Intl.Collator().compare.call(Intl.Collator('en', { sensitivity:'base' }), 'A', 'a')", "-1");
+shouldBe("new Intl.Collator().compare.call(5, 'a', 'b')", "-1");
+
+// 10.3.5 Intl.Collator.prototype.resolvedOptions ()
+
+shouldBe("Intl.Collator.prototype.resolvedOptions.length", "0");
+
+// Returns a new object whose properties and attributes are set as if constructed by an object literal.
+shouldBeType("Intl.Collator.prototype.resolvedOptions()", "Object");
+
+// Returns a new object each time.
+shouldBeFalse("Intl.Collator.prototype.resolvedOptions() === Intl.Collator.prototype.resolvedOptions()");
+
+// Throws on non-Collator this.
+shouldThrow("Intl.Collator.prototype.resolvedOptions.call(5)", "'TypeError: Intl.Collator.prototype.resolvedOptions called on value that\\'s not an object initialized as a Collator'");
+
diff --git a/LayoutTests/js/script-tests/intl-datetimeformat.js b/LayoutTests/js/script-tests/intl-datetimeformat.js
new file mode 100644 (file)
index 0000000..bf8a9cd
--- /dev/null
@@ -0,0 +1,109 @@
+description("This test checks the behavior of Intl.DateTimeFormat as described in the ECMAScript Internationalization API Specification (ECMA-402 2.0).");
+
+// 12.1 The Intl.DateTimeFormat Constructor
+
+// The Intl.DateTimeFormat constructor is a standard built-in property of the Intl object.
+shouldBeType("Intl.DateTimeFormat", "Function");
+
+// 12.1.2 Intl.DateTimeFormat([ locales [, options]])
+shouldBeType("Intl.DateTimeFormat()", "Intl.DateTimeFormat");
+shouldBeType("Intl.DateTimeFormat.call({})", "Intl.DateTimeFormat");
+shouldBeType("new Intl.DateTimeFormat()", "Intl.DateTimeFormat");
+
+// Subclassable
+class DerivedDateTimeFormat extends Intl.DateTimeFormat {}
+shouldBeType("new DerivedDateTimeFormat", "DerivedDateTimeFormat");
+shouldBeType("new DerivedDateTimeFormat", "Intl.DateTimeFormat");
+shouldBeTrue("new DerivedDateTimeFormat().format(0).length > 0");
+shouldBe("Object.getPrototypeOf(new DerivedDateTimeFormat)", "DerivedDateTimeFormat.prototype");
+shouldBe("Object.getPrototypeOf(Object.getPrototypeOf(new DerivedDateTimeFormat))", "Intl.DateTimeFormat.prototype");
+
+// 12.2 Properties of the Intl.DateTimeFormat Constructor
+
+// length property (whose value is 0)
+shouldBe("Intl.DateTimeFormat.length", "0");
+
+// 12.2.1 Intl.DateTimeFormat.prototype
+
+// This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
+shouldBeFalse("Object.getOwnPropertyDescriptor(Intl.DateTimeFormat, 'prototype').writable");
+shouldBeFalse("Object.getOwnPropertyDescriptor(Intl.DateTimeFormat, 'prototype').enumerable");
+shouldBeFalse("Object.getOwnPropertyDescriptor(Intl.DateTimeFormat, 'prototype').configurable");
+
+// 12.2.2 Intl.DateTimeFormat.supportedLocalesOf (locales [, options ])
+
+// The value of the length property of the supportedLocalesOf method is 1.
+shouldBe("Intl.DateTimeFormat.supportedLocalesOf.length", "1");
+
+// Returns SupportedLocales
+shouldBeType("Intl.DateTimeFormat.supportedLocalesOf()", "Array");
+
+// 12.3 Properties of the Intl.DateTimeFormat Prototype Object
+
+// The value of Intl.DateTimeFormat.prototype.constructor is %DateTimeFormat%.
+shouldBe("Intl.DateTimeFormat.prototype.constructor", "Intl.DateTimeFormat");
+
+// 12.3.3 Intl.DateTimeFormat.prototype.format
+
+// This named accessor property returns a function that formats a date according to the effective locale and the formatting options of this DateTimeFormat object.
+shouldBeType("Intl.DateTimeFormat.prototype.format", "Function");
+
+// The value of the [[Get]] attribute is a function
+shouldBeType("Object.getOwnPropertyDescriptor(Intl.DateTimeFormat.prototype, 'format').get", "Function");
+
+// The value of the [[Set]] attribute is undefined.
+shouldBe("Object.getOwnPropertyDescriptor(Intl.DateTimeFormat.prototype, 'format').set", "undefined");
+
+// Match Firefox where unspecifed.
+shouldBeFalse("Object.getOwnPropertyDescriptor(Intl.DateTimeFormat.prototype, 'format').enumerable");
+shouldBeTrue("Object.getOwnPropertyDescriptor(Intl.DateTimeFormat.prototype, 'format').configurable");
+
+// The value of F’s length property is 1.
+shouldBe("Intl.DateTimeFormat.prototype.format.length", "1");
+
+// Throws on non-DateTimeFormat this.
+shouldThrow("Object.defineProperty({}, 'format', Object.getOwnPropertyDescriptor(Intl.DateTimeFormat.prototype, 'format')).format", "'TypeError: Intl.DateTimeFormat.prototype.format called on value that\\'s not an object initialized as a DateTimeFormat'");
+
+// The format function is unique per instance.
+shouldBeTrue("Intl.DateTimeFormat.prototype.format !== Intl.DateTimeFormat().format");
+shouldBeTrue("new Intl.DateTimeFormat().format !== new Intl.DateTimeFormat().format");
+
+// 12.3.4 DateTime Format Functions
+
+// 1. Let dtf be the this value.
+// 2. Assert: Type(dtf) is Object and dtf has an [[initializedDateTimeFormat]] internal slot whose value is true.
+// This should not be reachable, since format is bound to an initialized datetimeformat.
+
+// 3. If date is not provided or is undefined, then
+// a. Let x be %Date_now%().
+// 4. Else
+// a. Let x be ToNumber(date).
+// b. ReturnIfAbrupt(x).
+shouldThrow("Intl.DateTimeFormat.prototype.format({ valueOf() { throw Error('4b') } })", "'Error: 4b'");
+
+// 12.3.4 FormatDateTime abstract operation
+
+// 1. If x is not a finite Number, then throw a RangeError exception.
+shouldThrow("Intl.DateTimeFormat.prototype.format(Infinity)", "'RangeError: date value is not finite in DateTimeFormat.format()'");
+
+// Format is bound, so calling with alternate "this" has no effect.
+shouldBe("Intl.DateTimeFormat.prototype.format.call(null, 0)", "Intl.DateTimeFormat().format(0)");
+shouldBe("Intl.DateTimeFormat.prototype.format.call(Intl.DateTimeFormat('ar'), 0)", "Intl.DateTimeFormat().format(0)");
+shouldBe("Intl.DateTimeFormat.prototype.format.call(5, 0)", "Intl.DateTimeFormat().format(0)");
+shouldBe("new Intl.DateTimeFormat().format.call(null, 0)", "Intl.DateTimeFormat().format(0)");
+shouldBe("new Intl.DateTimeFormat().format.call(Intl.DateTimeFormat('ar'), 0)", "Intl.DateTimeFormat().format(0)");
+shouldBe("new Intl.DateTimeFormat().format.call(5, 0)", "Intl.DateTimeFormat().format(0)");
+
+// 12.3.5 Intl.DateTimeFormat.prototype.resolvedOptions ()
+
+shouldBe("Intl.DateTimeFormat.prototype.resolvedOptions.length", "0");
+
+// Returns a new object whose properties and attributes are set as if constructed by an object literal.
+shouldBeType("Intl.DateTimeFormat.prototype.resolvedOptions()", "Object");
+
+// Returns a new object each time.
+shouldBeFalse("Intl.DateTimeFormat.prototype.resolvedOptions() === Intl.DateTimeFormat.prototype.resolvedOptions()");
+
+// Throws on non-DateTimeFormat this.
+shouldThrow("Intl.DateTimeFormat.prototype.resolvedOptions.call(5)", "'TypeError: Intl.DateTimeFormat.prototype.resolvedOptions called on value that\\'s not an object initialized as a DateTimeFormat'");
+
diff --git a/LayoutTests/js/script-tests/intl-numberformat.js b/LayoutTests/js/script-tests/intl-numberformat.js
new file mode 100644 (file)
index 0000000..f573b92
--- /dev/null
@@ -0,0 +1,102 @@
+description("This test checks the behavior of Intl.NumberFormat as described in the ECMAScript Internationalization API Specification (ECMA-402 2.0).");
+
+// 11.1 The Intl.NumberFormat Constructor
+
+// The Intl.NumberFormat constructor is a standard built-in property of the Intl object.
+shouldBeType("Intl.NumberFormat", "Function");
+
+// 11.1.2 Intl.NumberFormat([ locales [, options]])
+shouldBeType("Intl.NumberFormat()", "Intl.NumberFormat");
+shouldBeType("Intl.NumberFormat.call({})", "Intl.NumberFormat");
+shouldBeType("new Intl.NumberFormat()", "Intl.NumberFormat");
+
+// Subclassable
+class DerivedNumberFormat extends Intl.NumberFormat {}
+shouldBeType("new DerivedNumberFormat", "DerivedNumberFormat");
+shouldBeType("new DerivedNumberFormat", "Intl.NumberFormat");
+shouldBe("new DerivedNumberFormat().format(1)", "'1'");
+shouldBe("Object.getPrototypeOf(new DerivedNumberFormat)", "DerivedNumberFormat.prototype");
+shouldBe("Object.getPrototypeOf(Object.getPrototypeOf(new DerivedNumberFormat))", "Intl.NumberFormat.prototype");
+
+// 11.2 Properties of the Intl.NumberFormat Constructor
+
+// length property (whose value is 0)
+shouldBe("Intl.NumberFormat.length", "0");
+
+// 11.2.1 Intl.NumberFormat.prototype
+
+// This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
+shouldBeFalse("Object.getOwnPropertyDescriptor(Intl.NumberFormat, 'prototype').writable");
+shouldBeFalse("Object.getOwnPropertyDescriptor(Intl.NumberFormat, 'prototype').enumerable");
+shouldBeFalse("Object.getOwnPropertyDescriptor(Intl.NumberFormat, 'prototype').configurable");
+
+// 11.2.2 Intl.NumberFormat.supportedLocalesOf (locales [, options ])
+
+// The value of the length property of the supportedLocalesOf method is 1.
+shouldBe("Intl.NumberFormat.supportedLocalesOf.length", "1");
+
+// Returns SupportedLocales
+shouldBeType("Intl.NumberFormat.supportedLocalesOf()", "Array");
+
+// 11.3 Properties of the Intl.NumberFormat Prototype Object
+
+// The value of Intl.NumberFormat.prototype.constructor is %NumberFormat%.
+shouldBe("Intl.NumberFormat.prototype.constructor", "Intl.NumberFormat");
+
+// 11.3.3 Intl.NumberFormat.prototype.format
+
+// This named accessor property returns a function that formats a number according to the effective locale and the formatting options of this NumberFormat object.
+shouldBeType("Intl.NumberFormat.prototype.format", "Function");
+
+// The value of the [[Get]] attribute is a function
+shouldBeType("Object.getOwnPropertyDescriptor(Intl.NumberFormat.prototype, 'format').get", "Function");
+
+// The value of the [[Set]] attribute is undefined.
+shouldBe("Object.getOwnPropertyDescriptor(Intl.NumberFormat.prototype, 'format').set", "undefined");
+
+// Match Firefox where unspecifed.
+shouldBeFalse("Object.getOwnPropertyDescriptor(Intl.NumberFormat.prototype, 'format').enumerable");
+shouldBeTrue("Object.getOwnPropertyDescriptor(Intl.NumberFormat.prototype, 'format').configurable");
+
+// The value of F’s length property is 1.
+shouldBe("Intl.NumberFormat.prototype.format.length", "1");
+
+// Throws on non-NumberFormat this.
+shouldThrow("Object.defineProperty({}, 'format', Object.getOwnPropertyDescriptor(Intl.NumberFormat.prototype, 'format')).format", "'TypeError: Intl.NumberFormat.prototype.format called on value that\\'s not an object initialized as a NumberFormat'");
+
+// The format function is unique per instance.
+shouldBeTrue("Intl.NumberFormat.prototype.format !== Intl.NumberFormat().format");
+shouldBeTrue("new Intl.NumberFormat().format !== new Intl.NumberFormat().format");
+
+// 11.3.4 Format Number Functions
+
+// 1. Let nf be the this value.
+// 2. Assert: Type(nf) is Object and nf has an [[initializedNumberFormat]] internal slot whose value is true.
+// This should not be reachable, since format is bound to an initialized numberformat.
+
+// 3. If value is not provided, let value be undefined.
+// 4. Let x be ToNumber(value).
+// 5. ReturnIfAbrupt(x).
+shouldThrow("Intl.NumberFormat.prototype.format({ valueOf() { throw Error('5') } })", "'Error: 5'");
+
+// Format is bound, so calling with alternate "this" has no effect.
+shouldBe("Intl.NumberFormat.prototype.format.call(null, 1.2)", "Intl.NumberFormat().format(1.2)");
+shouldBe("Intl.NumberFormat.prototype.format.call(Intl.DateTimeFormat('ar'), 1.2)", "Intl.NumberFormat().format(1.2)");
+shouldBe("Intl.NumberFormat.prototype.format.call(5, 1.2)", "Intl.NumberFormat().format(1.2)");
+shouldBe("new Intl.NumberFormat().format.call(null, 1.2)", "Intl.NumberFormat().format(1.2)");
+shouldBe("new Intl.NumberFormat().format.call(Intl.DateTimeFormat('ar'), 1.2)", "Intl.NumberFormat().format(1.2)");
+shouldBe("new Intl.NumberFormat().format.call(5, 1.2)", "Intl.NumberFormat().format(1.2)");
+
+// 11.3.5 Intl.NumberFormat.prototype.resolvedOptions ()
+
+shouldBe("Intl.NumberFormat.prototype.resolvedOptions.length", "0");
+
+// Returns a new object whose properties and attributes are set as if constructed by an object literal.
+shouldBeType("Intl.NumberFormat.prototype.resolvedOptions()", "Object");
+
+// Returns a new object each time.
+shouldBeFalse("Intl.NumberFormat.prototype.resolvedOptions() === Intl.NumberFormat.prototype.resolvedOptions()");
+
+// Throws on non-NumberFormat this.
+shouldThrow("Intl.NumberFormat.prototype.resolvedOptions.call(5)", "'TypeError: Intl.NumberFormat.prototype.resolvedOptions called on value that\\'s not an object initialized as a NumberFormat'");
+
index 8a4cf58..0968287 100644 (file)
@@ -1,23 +1,26 @@
-// This feature isn't enabled yet.
-//@ skip
+description("This test checks the behavior of the Intl object as described in the ECMAScript Internationalization API Specification (ECMA-402 2.0).");
 
-description("This test checks the behavior of the Intl object as described in 8 of the ECMAScript Internationalization API Specification.");
+// 8 The Intl Object
 
-// The Intl object is a standard built-in object that is the initial value of the Intl property of the global object.
+// The Intl object is a single ordinary object.
 shouldBeType("Intl", "Object");
 shouldBe("typeof Intl", "'object'");
 shouldBe("Object.prototype.toString.call(Intl)", "'[object Object]'");
 
-// The value of the [[Prototype]] internal property of the Intl object is the built-in Object prototype object specified by the ECMAScript Language Specification.
+// The value of the [[Prototype]] internal slot of the Intl object is the intrinsic object %ObjectPrototype%.
 shouldBeTrue("Object.getPrototypeOf(Intl) === Object.prototype");
 
-// The Intl object does not have a [[Construct]] internal property; it is not possible to use the Intl object as a constructor with the new operator.
+// The Intl object is not a function object.
+// It does not have a [[Construct]] internal method; it is not possible to use the Intl object as a constructor with the new operator.
 shouldThrow("new Intl", "'TypeError: Object is not a constructor (evaluating \\'new Intl\\')'");
 
-// The Intl object does not have a [[Call]] internal property; it is not possible to invoke the Intl object as a function.
+// The Intl object does not have a [[Call]] internal method; it is not possible to invoke the Intl object as a function.
 shouldThrow("Intl()", "'TypeError: Intl is not a function. (In \\'Intl()\\', \\'Intl\\' is an instance of Object)'");
 
-// is deletable, inferred from use of "Initial" in spec, consistent with other implementations
+// Has only the built-in Collator, DateTimeFormat, and NumberFormat, which are not enumerable.
+shouldBe("Object.keys(Intl).length", "0");
+
+// Is deletable, inferred from use of "Initial" in spec, consistent with other implementations.
 var __Intl = Intl;
 shouldBeTrue("delete Intl;");
 
@@ -25,3 +28,4 @@ function global() { return this; }
 shouldBeFalse("'Intl' in global()");
 
 Intl = __Intl;
+
index 51fc49d..45ba585 100644 (file)
@@ -476,6 +476,15 @@ set(JavaScriptCore_RUNTIME_SOURCES
     runtime/InitializeThreading.cpp
     runtime/IntendedStructureChain.cpp
     runtime/InternalFunction.cpp
+    runtime/IntlCollator.cpp
+    runtime/IntlCollatorConstructor.cpp
+    runtime/IntlCollatorPrototype.cpp
+    runtime/IntlDateTimeFormat.cpp
+    runtime/IntlDateTimeFormatConstructor.cpp
+    runtime/IntlDateTimeFormatPrototype.cpp
+    runtime/IntlNumberFormat.cpp
+    runtime/IntlNumberFormatConstructor.cpp
+    runtime/IntlNumberFormatPrototype.cpp
     runtime/IntlObject.cpp
     runtime/IteratorOperations.cpp
     runtime/IteratorPrototype.cpp
@@ -621,6 +630,12 @@ set(JavaScriptCore_LUT_FILES
     runtime/DateConstructor.cpp
     runtime/DatePrototype.cpp
     runtime/ErrorPrototype.cpp
+    runtime/IntlCollatorConstructor.cpp
+    runtime/IntlCollatorPrototype.cpp
+    runtime/IntlDateTimeFormatConstructor.cpp
+    runtime/IntlDateTimeFormatPrototype.cpp
+    runtime/IntlNumberFormatConstructor.cpp
+    runtime/IntlNumberFormatPrototype.cpp
     runtime/JSDataViewPrototype.cpp
     runtime/JSGlobalObject.cpp
     runtime/JSONObject.cpp
index da1f0f9..3bdb2a2 100644 (file)
@@ -1,3 +1,144 @@
+2015-07-29  Andy VanWagoner  <thetalecrafter@gmail.com>
+
+        Implement basic types for ECMAScript Internationalization API
+        https://bugs.webkit.org/show_bug.cgi?id=146926
+
+        Reviewed by Benjamin Poulain.
+
+        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):
+
 2015-07-29  Commit Queue  <commit-queue@webkit.org>
 
         Unreviewed, rolling out r187550.
index e160c7f..bce860a 100644 (file)
@@ -117,7 +117,7 @@ ENABLE_WIRELESS_PLAYBACK_TARGET_macosx_101000 = ;
 ENABLE_WIRELESS_PLAYBACK_TARGET_macosx_101100 = ENABLE_WIRELESS_PLAYBACK_TARGET;
 ENABLE_WIRELESS_PLAYBACK_TARGET_macosx_101200 = ENABLE_WIRELESS_PLAYBACK_TARGET;
 
-ENABLE_INTL = ;
+ENABLE_INTL = ENABLE_INTL;
 
 ENABLE_IOS_GESTURE_EVENTS[sdk=iphone*] = $(ENABLE_IOS_GESTURE_EVENTS_ios_WITH_INTERNAL_SDK_$(USE_INTERNAL_SDK));
 ENABLE_IOS_GESTURE_EVENTS_ios_WITH_INTERNAL_SDK_YES = ENABLE_IOS_GESTURE_EVENTS;
index f35ab86..d071265 100644 (file)
@@ -41,6 +41,12 @@ all : \
     DateConstructor.lut.h \
     DatePrototype.lut.h \
     ErrorPrototype.lut.h \
+    IntlCollatorConstructor.lut.h \
+    IntlCollatorPrototype.lut.h \
+    IntlDateTimeFormatConstructor.lut.h \
+    IntlDateTimeFormatPrototype.lut.h \
+    IntlNumberFormatConstructor.lut.h \
+    IntlNumberFormatPrototype.lut.h \
     JSDataViewPrototype.lut.h \
     JSONObject.lut.h \
     JSGlobalObject.lut.h \
index a45ab66..e676338 100644 (file)
     <ClCompile Include="..\runtime\InitializeThreading.cpp" />
     <ClCompile Include="..\runtime\IntendedStructureChain.cpp" />
     <ClCompile Include="..\runtime\InternalFunction.cpp" />
+    <ClCompile Include="..\runtime\IntlCollator.cpp" />
+    <ClCompile Include="..\runtime\IntlCollatorConstructor.cpp" />
+    <ClCompile Include="..\runtime\IntlCollatorPrototype.cpp" />
+    <ClCompile Include="..\runtime\IntlDateTimeFormat.cpp" />
+    <ClCompile Include="..\runtime\IntlDateTimeFormatConstructor.cpp" />
+    <ClCompile Include="..\runtime\IntlDateTimeFormatPrototype.cpp" />
+    <ClCompile Include="..\runtime\IntlNumberFormat.cpp" />
+    <ClCompile Include="..\runtime\IntlNumberFormatConstructor.cpp" />
+    <ClCompile Include="..\runtime\IntlNumberFormatPrototype.cpp" />
     <ClCompile Include="..\runtime\IntlObject.cpp" />
     <ClCompile Include="..\runtime\IteratorOperations.cpp" />
     <ClCompile Include="..\runtime\IteratorPrototype.cpp" />
     <ClInclude Include="..\runtime\Int8Array.h" />
     <ClInclude Include="..\runtime\IntendedStructureChain.h" />
     <ClInclude Include="..\runtime\InternalFunction.h" />
+    <ClInclude Include="..\runtime\IntlCollator.h" />
+    <ClInclude Include="..\runtime\IntlCollatorConstructor.h" />
+    <ClInclude Include="..\runtime\IntlCollatorPrototype.h" />
+    <ClInclude Include="..\runtime\IntlDateTimeFormat.h" />
+    <ClInclude Include="..\runtime\IntlDateTimeFormatConstructor.h" />
+    <ClInclude Include="..\runtime\IntlDateTimeFormatPrototype.h" />
+    <ClInclude Include="..\runtime\IntlNumberFormat.h" />
+    <ClInclude Include="..\runtime\IntlNumberFormatConstructor.h" />
+    <ClInclude Include="..\runtime\IntlNumberFormatPrototype.h" />
     <ClInclude Include="..\runtime\IntlObject.h" />
     <ClInclude Include="..\runtime\Intrinsic.h" />
     <ClInclude Include="..\runtime\IterationStatus.h" />
index 6ce3677..f66c9bc 100644 (file)
     <ClCompile Include="..\runtime\InternalFunction.cpp">
       <Filter>runtime</Filter>
     </ClCompile>
+    <ClCompile Include="..\runtime\IntlCollator.cpp">
+      <Filter>runtime</Filter>
+    </ClCompile>
+    <ClCompile Include="..\runtime\IntlCollatorConstructor.cpp">
+      <Filter>runtime</Filter>
+    </ClCompile>
+    <ClCompile Include="..\runtime\IntlCollatorPrototype.cpp">
+      <Filter>runtime</Filter>
+    </ClCompile>
+    <ClCompile Include="..\runtime\IntlDateTimeFormat.cpp">
+      <Filter>runtime</Filter>
+    </ClCompile>
+    <ClCompile Include="..\runtime\IntlDateTimeFormatConstructor.cpp">
+      <Filter>runtime</Filter>
+    </ClCompile>
+    <ClCompile Include="..\runtime\IntlDateTimeFormatPrototype.cpp">
+      <Filter>runtime</Filter>
+    </ClCompile>
+    <ClCompile Include="..\runtime\IntlNumberFormat.cpp">
+      <Filter>runtime</Filter>
+    </ClCompile>
+    <ClCompile Include="..\runtime\IntlNumberFormatConstructor.cpp">
+      <Filter>runtime</Filter>
+    </ClCompile>
+    <ClCompile Include="..\runtime\IntlNumberFormatPrototype.cpp">
+      <Filter>runtime</Filter>
+    </ClCompile>
     <ClCompile Include="..\runtime\IntlObject.cpp">
       <Filter>runtime</Filter>
     </ClCompile>
     <ClInclude Include="..\runtime\InternalFunction.h">
       <Filter>runtime</Filter>
     </ClInclude>
+    <ClInclude Include="..\runtime\IntlCollator.h">
+      <Filter>runtime</Filter>
+    </ClInclude>
+    <ClInclude Include="..\runtime\IntlCollatorConstructor.h">
+      <Filter>runtime</Filter>
+    </ClInclude>
+    <ClInclude Include="..\runtime\IntlCollatorPrototype.h">
+      <Filter>runtime</Filter>
+    </ClInclude>
+    <ClInclude Include="..\runtime\IntlDateTimeFormat.h">
+      <Filter>runtime</Filter>
+    </ClInclude>
+    <ClInclude Include="..\runtime\IntlDateTimeFormatConstructor.h">
+      <Filter>runtime</Filter>
+    </ClInclude>
+    <ClInclude Include="..\runtime\IntlDateTimeFormatPrototype.h">
+      <Filter>runtime</Filter>
+    </ClInclude>
+    <ClInclude Include="..\runtime\IntlNumberFormat.h">
+      <Filter>runtime</Filter>
+    </ClInclude>
+    <ClInclude Include="..\runtime\IntlNumberFormatConstructor.h">
+      <Filter>runtime</Filter>
+    </ClInclude>
+    <ClInclude Include="..\runtime\IntlNumberFormatPrototype.h">
+      <Filter>runtime</Filter>
+    </ClInclude>
     <ClInclude Include="..\runtime\IntlObject.h">
       <Filter>runtime</Filter>
     </ClInclude>
index 699e7a6..aeee102 100644 (file)
                9E72940B190F0514001A91B5 /* BundlePath.h in Headers */ = {isa = PBXBuildFile; fileRef = 9E72940A190F0514001A91B5 /* BundlePath.h */; };
                9EA5C7A1190F084200508EBE /* BundlePath.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9E729409190F0306001A91B5 /* BundlePath.mm */; };
                9EA5C7A2190F088700508EBE /* InitializeLLVMMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9EA5C7A0190F05D200508EBE /* InitializeLLVMMac.cpp */; };
+               A125846E1B45A36000CC7F6C /* IntlNumberFormatConstructor.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = A125846C1B45A36000CC7F6C /* IntlNumberFormatConstructor.lut.h */; };
+               A125846F1B45A36000CC7F6C /* IntlNumberFormatPrototype.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = A125846D1B45A36000CC7F6C /* IntlNumberFormatPrototype.lut.h */; };
                A12BBFF21B044A8B00664B69 /* IntlObject.h in Headers */ = {isa = PBXBuildFile; fileRef = A12BBFF11B044A8B00664B69 /* IntlObject.h */; };
                A12BBFF41B044A9800664B69 /* IntlObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A12BBFF31B044A9800664B69 /* IntlObject.cpp */; };
+               A1587D6D1B4DC14100D69849 /* IntlDateTimeFormat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1587D671B4DC14100D69849 /* IntlDateTimeFormat.cpp */; };
+               A1587D6E1B4DC14100D69849 /* IntlDateTimeFormat.h in Headers */ = {isa = PBXBuildFile; fileRef = A1587D681B4DC14100D69849 /* IntlDateTimeFormat.h */; };
+               A1587D6F1B4DC14100D69849 /* IntlDateTimeFormatConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1587D691B4DC14100D69849 /* IntlDateTimeFormatConstructor.cpp */; };
+               A1587D701B4DC14100D69849 /* IntlDateTimeFormatConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = A1587D6A1B4DC14100D69849 /* IntlDateTimeFormatConstructor.h */; };
+               A1587D711B4DC14100D69849 /* IntlDateTimeFormatPrototype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1587D6B1B4DC14100D69849 /* IntlDateTimeFormatPrototype.cpp */; };
+               A1587D721B4DC14100D69849 /* IntlDateTimeFormatPrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = A1587D6C1B4DC14100D69849 /* IntlDateTimeFormatPrototype.h */; };
+               A1587D751B4DC1C600D69849 /* IntlDateTimeFormatConstructor.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = A1587D731B4DC1C600D69849 /* IntlDateTimeFormatConstructor.lut.h */; };
+               A1587D761B4DC1C600D69849 /* IntlDateTimeFormatPrototype.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = A1587D741B4DC1C600D69849 /* IntlDateTimeFormatPrototype.lut.h */; };
                A1712B3B11C7B212007A5315 /* RegExpCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1712B3A11C7B212007A5315 /* RegExpCache.cpp */; };
                A1712B3F11C7B228007A5315 /* RegExpCache.h in Headers */ = {isa = PBXBuildFile; fileRef = A1712B3E11C7B228007A5315 /* RegExpCache.h */; settings = {ATTRIBUTES = (Private, ); }; };
                A1712B4111C7B235007A5315 /* RegExpKey.h in Headers */ = {isa = PBXBuildFile; fileRef = A1712B4011C7B235007A5315 /* RegExpKey.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               A18193E31B4E0CDB00FC1029 /* IntlCollatorConstructor.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = A18193E11B4E0CDB00FC1029 /* IntlCollatorConstructor.lut.h */; };
+               A18193E41B4E0CDB00FC1029 /* IntlCollatorPrototype.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = A18193E21B4E0CDB00FC1029 /* IntlCollatorPrototype.lut.h */; };
                A1A009C01831A22D00CF8711 /* MacroAssemblerARM64.h in Headers */ = {isa = PBXBuildFile; fileRef = 8640923C156EED3B00566CB2 /* MacroAssemblerARM64.h */; settings = {ATTRIBUTES = (Private, ); }; };
                A1A009C11831A26E00CF8711 /* ARM64Assembler.h in Headers */ = {isa = PBXBuildFile; fileRef = 8640923B156EED3B00566CB2 /* ARM64Assembler.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               A1B9E2391B4E0D6700BC7FED /* IntlCollator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1B9E2331B4E0D6700BC7FED /* IntlCollator.cpp */; };
+               A1B9E23A1B4E0D6700BC7FED /* IntlCollator.h in Headers */ = {isa = PBXBuildFile; fileRef = A1B9E2341B4E0D6700BC7FED /* IntlCollator.h */; };
+               A1B9E23B1B4E0D6700BC7FED /* IntlCollatorConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1B9E2351B4E0D6700BC7FED /* IntlCollatorConstructor.cpp */; };
+               A1B9E23C1B4E0D6700BC7FED /* IntlCollatorConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = A1B9E2361B4E0D6700BC7FED /* IntlCollatorConstructor.h */; };
+               A1B9E23D1B4E0D6700BC7FED /* IntlCollatorPrototype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1B9E2371B4E0D6700BC7FED /* IntlCollatorPrototype.cpp */; };
+               A1B9E23E1B4E0D6700BC7FED /* IntlCollatorPrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = A1B9E2381B4E0D6700BC7FED /* IntlCollatorPrototype.h */; };
+               A1D792FC1B43864B004516F5 /* IntlNumberFormat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1D792F61B43864B004516F5 /* IntlNumberFormat.cpp */; };
+               A1D792FD1B43864B004516F5 /* IntlNumberFormat.h in Headers */ = {isa = PBXBuildFile; fileRef = A1D792F71B43864B004516F5 /* IntlNumberFormat.h */; };
+               A1D792FE1B43864B004516F5 /* IntlNumberFormatConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1D792F81B43864B004516F5 /* IntlNumberFormatConstructor.cpp */; };
+               A1D792FF1B43864B004516F5 /* IntlNumberFormatConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = A1D792F91B43864B004516F5 /* IntlNumberFormatConstructor.h */; };
+               A1D793001B43864B004516F5 /* IntlNumberFormatPrototype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1D792FA1B43864B004516F5 /* IntlNumberFormatPrototype.cpp */; };
+               A1D793011B43864B004516F5 /* IntlNumberFormatPrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = A1D792FB1B43864B004516F5 /* IntlNumberFormatPrototype.h */; };
                A503FA19188E0FB000110F14 /* JavaScriptCallFrame.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A503FA13188E0FAF00110F14 /* JavaScriptCallFrame.cpp */; };
                A503FA1A188E0FB000110F14 /* JavaScriptCallFrame.h in Headers */ = {isa = PBXBuildFile; fileRef = A503FA14188E0FAF00110F14 /* JavaScriptCallFrame.h */; };
                A503FA1B188E0FB000110F14 /* JSJavaScriptCallFrame.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A503FA15188E0FB000110F14 /* JSJavaScriptCallFrame.cpp */; };
                9E729409190F0306001A91B5 /* BundlePath.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = BundlePath.mm; sourceTree = "<group>"; };
                9E72940A190F0514001A91B5 /* BundlePath.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BundlePath.h; sourceTree = "<group>"; };
                9EA5C7A0190F05D200508EBE /* InitializeLLVMMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = InitializeLLVMMac.cpp; path = llvm/InitializeLLVMMac.cpp; sourceTree = "<group>"; };
+               A125846C1B45A36000CC7F6C /* IntlNumberFormatConstructor.lut.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IntlNumberFormatConstructor.lut.h; sourceTree = "<group>"; };
+               A125846D1B45A36000CC7F6C /* IntlNumberFormatPrototype.lut.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IntlNumberFormatPrototype.lut.h; sourceTree = "<group>"; };
                A12BBFF11B044A8B00664B69 /* IntlObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IntlObject.h; sourceTree = "<group>"; };
                A12BBFF31B044A9800664B69 /* IntlObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IntlObject.cpp; sourceTree = "<group>"; };
+               A1587D671B4DC14100D69849 /* IntlDateTimeFormat.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IntlDateTimeFormat.cpp; sourceTree = "<group>"; };
+               A1587D681B4DC14100D69849 /* IntlDateTimeFormat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IntlDateTimeFormat.h; sourceTree = "<group>"; };
+               A1587D691B4DC14100D69849 /* IntlDateTimeFormatConstructor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IntlDateTimeFormatConstructor.cpp; sourceTree = "<group>"; };
+               A1587D6A1B4DC14100D69849 /* IntlDateTimeFormatConstructor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IntlDateTimeFormatConstructor.h; sourceTree = "<group>"; };
+               A1587D6B1B4DC14100D69849 /* IntlDateTimeFormatPrototype.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IntlDateTimeFormatPrototype.cpp; sourceTree = "<group>"; };
+               A1587D6C1B4DC14100D69849 /* IntlDateTimeFormatPrototype.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IntlDateTimeFormatPrototype.h; sourceTree = "<group>"; };
+               A1587D731B4DC1C600D69849 /* IntlDateTimeFormatConstructor.lut.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IntlDateTimeFormatConstructor.lut.h; sourceTree = "<group>"; };
+               A1587D741B4DC1C600D69849 /* IntlDateTimeFormatPrototype.lut.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IntlDateTimeFormatPrototype.lut.h; sourceTree = "<group>"; };
                A1712B3A11C7B212007A5315 /* RegExpCache.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RegExpCache.cpp; sourceTree = "<group>"; };
                A1712B3E11C7B228007A5315 /* RegExpCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegExpCache.h; sourceTree = "<group>"; };
                A1712B4011C7B235007A5315 /* RegExpKey.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegExpKey.h; sourceTree = "<group>"; };
+               A18193E11B4E0CDB00FC1029 /* IntlCollatorConstructor.lut.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IntlCollatorConstructor.lut.h; sourceTree = "<group>"; };
+               A18193E21B4E0CDB00FC1029 /* IntlCollatorPrototype.lut.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IntlCollatorPrototype.lut.h; sourceTree = "<group>"; };
+               A1B9E2331B4E0D6700BC7FED /* IntlCollator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IntlCollator.cpp; sourceTree = "<group>"; };
+               A1B9E2341B4E0D6700BC7FED /* IntlCollator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IntlCollator.h; sourceTree = "<group>"; };
+               A1B9E2351B4E0D6700BC7FED /* IntlCollatorConstructor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IntlCollatorConstructor.cpp; sourceTree = "<group>"; };
+               A1B9E2361B4E0D6700BC7FED /* IntlCollatorConstructor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IntlCollatorConstructor.h; sourceTree = "<group>"; };
+               A1B9E2371B4E0D6700BC7FED /* IntlCollatorPrototype.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IntlCollatorPrototype.cpp; sourceTree = "<group>"; };
+               A1B9E2381B4E0D6700BC7FED /* IntlCollatorPrototype.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IntlCollatorPrototype.h; sourceTree = "<group>"; };
+               A1D792F61B43864B004516F5 /* IntlNumberFormat.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IntlNumberFormat.cpp; sourceTree = "<group>"; };
+               A1D792F71B43864B004516F5 /* IntlNumberFormat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IntlNumberFormat.h; sourceTree = "<group>"; };
+               A1D792F81B43864B004516F5 /* IntlNumberFormatConstructor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IntlNumberFormatConstructor.cpp; sourceTree = "<group>"; };
+               A1D792F91B43864B004516F5 /* IntlNumberFormatConstructor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IntlNumberFormatConstructor.h; sourceTree = "<group>"; };
+               A1D792FA1B43864B004516F5 /* IntlNumberFormatPrototype.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IntlNumberFormatPrototype.cpp; sourceTree = "<group>"; };
+               A1D792FB1B43864B004516F5 /* IntlNumberFormatPrototype.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IntlNumberFormatPrototype.h; sourceTree = "<group>"; };
                A503FA13188E0FAF00110F14 /* JavaScriptCallFrame.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JavaScriptCallFrame.cpp; sourceTree = "<group>"; };
                A503FA14188E0FAF00110F14 /* JavaScriptCallFrame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JavaScriptCallFrame.h; sourceTree = "<group>"; };
                A503FA15188E0FB000110F14 /* JSJavaScriptCallFrame.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSJavaScriptCallFrame.cpp; sourceTree = "<group>"; };
                                A532438418568317002ED692 /* InspectorFrontendDispatchers.h */,
                                A532438518568317002ED692 /* InspectorProtocolObjects.cpp */,
                                A532438618568317002ED692 /* InspectorProtocolObjects.h */,
+                               A18193E11B4E0CDB00FC1029 /* IntlCollatorConstructor.lut.h */,
+                               A18193E21B4E0CDB00FC1029 /* IntlCollatorPrototype.lut.h */,
+                               A1587D731B4DC1C600D69849 /* IntlDateTimeFormatConstructor.lut.h */,
+                               A1587D741B4DC1C600D69849 /* IntlDateTimeFormatPrototype.lut.h */,
+                               A125846C1B45A36000CC7F6C /* IntlNumberFormatConstructor.lut.h */,
+                               A125846D1B45A36000CC7F6C /* IntlNumberFormatPrototype.lut.h */,
                                A7D801A61880D6A80026C39B /* JSCBuiltins.cpp */,
                                A7D801A71880D6A80026C39B /* JSCBuiltins.h */,
                                BC87CDB810712ACA000614CF /* JSONObject.lut.h */,
                                A78853F817972629001440E4 /* IntendedStructureChain.h */,
                                BC9BB95B0E19680600DF8855 /* InternalFunction.cpp */,
                                BC11667A0E199C05008066DD /* InternalFunction.h */,
+                               A1B9E2331B4E0D6700BC7FED /* IntlCollator.cpp */,
+                               A1B9E2341B4E0D6700BC7FED /* IntlCollator.h */,
+                               A1B9E2351B4E0D6700BC7FED /* IntlCollatorConstructor.cpp */,
+                               A1B9E2361B4E0D6700BC7FED /* IntlCollatorConstructor.h */,
+                               A1B9E2371B4E0D6700BC7FED /* IntlCollatorPrototype.cpp */,
+                               A1B9E2381B4E0D6700BC7FED /* IntlCollatorPrototype.h */,
+                               A1587D671B4DC14100D69849 /* IntlDateTimeFormat.cpp */,
+                               A1587D681B4DC14100D69849 /* IntlDateTimeFormat.h */,
+                               A1587D691B4DC14100D69849 /* IntlDateTimeFormatConstructor.cpp */,
+                               A1587D6A1B4DC14100D69849 /* IntlDateTimeFormatConstructor.h */,
+                               A1587D6B1B4DC14100D69849 /* IntlDateTimeFormatPrototype.cpp */,
+                               A1587D6C1B4DC14100D69849 /* IntlDateTimeFormatPrototype.h */,
+                               A1D792F61B43864B004516F5 /* IntlNumberFormat.cpp */,
+                               A1D792F71B43864B004516F5 /* IntlNumberFormat.h */,
+                               A1D792F81B43864B004516F5 /* IntlNumberFormatConstructor.cpp */,
+                               A1D792F91B43864B004516F5 /* IntlNumberFormatConstructor.h */,
+                               A1D792FA1B43864B004516F5 /* IntlNumberFormatPrototype.cpp */,
+                               A1D792FB1B43864B004516F5 /* IntlNumberFormatPrototype.h */,
                                A12BBFF31B044A9800664B69 /* IntlObject.cpp */,
                                A12BBFF11B044A8B00664B69 /* IntlObject.h */,
                                86BF642A148DB2B5004DE36A /* Intrinsic.h */,
                                147B83AC0E6DB8C9004775A4 /* BatchedTransitionOptimizer.h in Headers */,
                                2A111246192FCE79005EE18D /* CustomGetterSetter.h in Headers */,
                                C4F4B6F51A05C984005CAB76 /* generate_objc_protocol_types_implementation.py in Headers */,
+                               A1D792FF1B43864B004516F5 /* IntlNumberFormatConstructor.h in Headers */,
                                A584032018BFFBE1005A0811 /* InspectorAgent.h in Headers */,
                                2AABCDE718EF294200002096 /* GCLogging.h in Headers */,
                                FE7BA6101A1A7CEC00F1F7B4 /* HeapVerifier.h in Headers */,
                                0F24E54117EA9F5900ABB217 /* AssemblyHelpers.h in Headers */,
                                A784A26111D16622005776AC /* ASTBuilder.h in Headers */,
                                866739D213BFDE710023D87C /* BigInteger.h in Headers */,
+                               A125846E1B45A36000CC7F6C /* IntlNumberFormatConstructor.lut.h in Headers */,
                                BC18C3EC0E16F5CD00B34460 /* BooleanObject.h in Headers */,
                                FEA08620182B7A0400F6D851 /* Breakpoint.h in Headers */,
                                A5D2E665195E174000A518E7 /* JSContextRefInternal.h in Headers */,
                                0FB7F39715ED8E4600F167B2 /* Butterfly.h in Headers */,
                                0FB7F39815ED8E4600F167B2 /* ButterflyInlines.h in Headers */,
                                62D2D3901ADF103F000206C1 /* FunctionRareData.h in Headers */,
+                               A1B9E23A1B4E0D6700BC7FED /* IntlCollator.h in Headers */,
                                C2FCAE1117A9C24E0034C735 /* BytecodeBasicBlock.h in Headers */,
                                0F21C27F14BEAA8200ADC64B /* BytecodeConventions.h in Headers */,
                                969A07230ED1CE3300F1F681 /* BytecodeGenerator.h in Headers */,
                                A5EA70E819F5B1010098F5EC /* AugmentableInspectorControllerClient.h in Headers */,
                                A704D90317A0BAA8006BA554 /* DFGAbstractInterpreter.h in Headers */,
                                A704D90417A0BAA8006BA554 /* DFGAbstractInterpreterInlines.h in Headers */,
+                               A1B9E23C1B4E0D6700BC7FED /* IntlCollatorConstructor.h in Headers */,
                                0F620177143FCD3F0068B77C /* DFGAbstractValue.h in Headers */,
                                0FF054FA1AC35B4400E5BE57 /* ExecutableAllocationFuzz.h in Headers */,
                                0F66E16B14DF3F1600B7B2E4 /* DFGAdjacencyList.h in Headers */,
                                0FFB921816D02EB20055A5DB /* DFGAllocator.h in Headers */,
                                A737810C1799EA2E00817533 /* DFGAnalysis.h in Headers */,
+                               A1B9E23E1B4E0D6700BC7FED /* IntlCollatorPrototype.h in Headers */,
                                0F1E3A461534CBAF000F9456 /* DFGArgumentPosition.h in Headers */,
                                A5C3A1A618C0490200C9593A /* JSGlobalObjectConsoleClient.h in Headers */,
                                0F485322187750560083B687 /* DFGArithMode.h in Headers */,
                                86EC9DCC1328DF82002B2AD7 /* DFGJITCompiler.h in Headers */,
                                A78A9779179738B8009DF744 /* DFGJITFinalizer.h in Headers */,
                                0FC97F4018202119002C9B26 /* DFGJumpReplacement.h in Headers */,
+                               A125846F1B45A36000CC7F6C /* IntlNumberFormatPrototype.lut.h in Headers */,
                                A73A535B1799CD5D00170C19 /* DFGLazyJSValue.h in Headers */,
                                0F2B9CE919D0BA7D00B1D1B5 /* DFGObjectMaterializationData.h in Headers */,
                                A7D9A29817A0BC7400EE2618 /* DFGLICMPhase.h in Headers */,
                                0F6B1CB6185FC9E900845D97 /* FTLJSCall.h in Headers */,
                                0F8F2B96172E04A3007DBDA5 /* FTLLink.h in Headers */,
                                0FCEFAE0180738C000472CE4 /* FTLLocation.h in Headers */,
+                               A1587D701B4DC14100D69849 /* IntlDateTimeFormatConstructor.h in Headers */,
                                0FEA0A10170513DB00BB722C /* FTLLowerDFGToLLVM.h in Headers */,
                                A7D89D0217A0B90400773AD8 /* FTLLoweredNodeValue.h in Headers */,
                                0FD8A31C17D51F2200CA2C40 /* FTLOSREntry.h in Headers */,
                                C25F8BCE157544A900245B71 /* IncrementalSweeper.h in Headers */,
                                0FB7F39915ED8E4600F167B2 /* IndexingHeader.h in Headers */,
                                0FB7F39A15ED8E4600F167B2 /* IndexingHeaderInlines.h in Headers */,
+                               A1587D761B4DC1C600D69849 /* IntlDateTimeFormatPrototype.lut.h in Headers */,
                                0FB7F39B15ED8E4600F167B2 /* IndexingType.h in Headers */,
                                0FCEFAB01805CA6D00472CE4 /* InitializeLLVM.h in Headers */,
                                0FCEFACC1805E75500472CE4 /* InitializeLLVMPOSIX.h in Headers */,
                                0FAF7EFE165BA91F000C8455 /* JITDisassembler.h in Headers */,
                                0F46808214BA572D00BFE272 /* JITExceptions.h in Headers */,
                                0FB14E1F18124ACE009B6B4D /* JITInlineCacheGenerator.h in Headers */,
+                               A1D793011B43864B004516F5 /* IntlNumberFormatPrototype.h in Headers */,
                                86CC85A10EE79A4700288682 /* JITInlines.h in Headers */,
                                0F24E54D17EE274900ABB217 /* JITOperations.h in Headers */,
                                0F766D3115AA8112008F363E /* JITStubRoutine.h in Headers */,
                                7C184E2317BEE240007CB63A /* JSPromiseConstructor.h in Headers */,
                                7C008CDB187124BB00955C24 /* JSPromiseDeferred.h in Headers */,
                                7C184E1F17BEE22E007CB63A /* JSPromisePrototype.h in Headers */,
+                               A18193E41B4E0CDB00FC1029 /* IntlCollatorPrototype.lut.h in Headers */,
                                862553D216136E1A009F17D0 /* JSProxy.h in Headers */,
                                9928FF3C18AC4AEC00B8CF12 /* JSReplayInputs.h in Headers */,
                                BC18C4260E16F5CD00B34460 /* JSRetainPtr.h in Headers */,
                                BC18C45E0E16F5CD00B34460 /* JSStack.h in Headers */,
                                A7C1EAF017987AB600299DB2 /* JSStackInlines.h in Headers */,
                                BC18C4270E16F5CD00B34460 /* JSString.h in Headers */,
+                               A1587D751B4DC1C600D69849 /* IntlDateTimeFormatConstructor.lut.h in Headers */,
                                86E85539111B9968001AF51E /* JSStringBuilder.h in Headers */,
                                2600B5A7152BAAA70091EE5F /* JSStringJoiner.h in Headers */,
                                BC18C4280E16F5CD00B34460 /* JSStringRef.h in Headers */,
                                BC02E9110E1839DB000F9297 /* NativeErrorConstructor.h in Headers */,
                                BC02E9130E1839DB000F9297 /* NativeErrorPrototype.h in Headers */,
                                99CC0B6318BE9950006CEBCC /* CodeGeneratorReplayInputs.py in Headers */,
+                               A18193E31B4E0CDB00FC1029 /* IntlCollatorConstructor.lut.h in Headers */,
                                0FFB922016D033B70055A5DB /* NodeConstructors.h in Headers */,
                                70ECA6091AFDBEA200449739 /* TemplateRegistryKey.h in Headers */,
                                BC18C43F0E16F5CD00B34460 /* Nodes.h in Headers */,
                                A7299DA617D12858005F5FF9 /* SetConstructor.h in Headers */,
                                A790DD6E182F499700588807 /* SetIteratorPrototype.h in Headers */,
                                A7299DA217D12848005F5FF9 /* SetPrototype.h in Headers */,
+                               A1D792FD1B43864B004516F5 /* IntlNumberFormat.h in Headers */,
                                86AE64AA135E5E1C00963012 /* SH4Assembler.h in Headers */,
                                0FF8BDEB1AD4CF7100DFE884 /* InferredValue.h in Headers */,
                                0F2B670517B6B5AB00A7AE3F /* SimpleTypedArrayController.h in Headers */,
                                0F5F08CF146C7633000472A9 /* UnconditionalFinalizer.h in Headers */,
                                A7B601821639FD2A00372BA3 /* UnlinkedCodeBlock.h in Headers */,
                                0F2E892C16D028AD009E4FD2 /* UnusedPointer.h in Headers */,
+                               A1587D6E1B4DC14100D69849 /* IntlDateTimeFormat.h in Headers */,
                                0F963B3813FC6FE90002D9B2 /* ValueProfile.h in Headers */,
                                0F426A481460CBB300131F8F /* ValueRecovery.h in Headers */,
                                0F9C5E5F18E35F5E00D431C3 /* FTLDWARFRegister.h in Headers */,
                                2A4EC90C1860D6C20094F782 /* WriteBarrierBuffer.h in Headers */,
                                C2B6D75318A33793004A9301 /* WriteBarrierInlines.h in Headers */,
                                0FC8150A14043BF500CFA603 /* WriteBarrierSupport.h in Headers */,
+                               A1587D721B4DC14100D69849 /* IntlDateTimeFormatPrototype.h in Headers */,
                                9688CB160ED12B4E001D649F /* X86Assembler.h in Headers */,
                                A5840E2A187CA75900843B10 /* xxd.pl in Headers */,
                                0F3A1BFA1A9ECB7D000DE01A /* DFGPutStackSinkingPhase.h in Headers */,
                                0FEA0A31170D40BF00BB722C /* DFGCommonData.cpp in Sources */,
                                0F38B01717CFE75500B144D3 /* DFGCompilationKey.cpp in Sources */,
                                0F38B01917CFE75500B144D3 /* DFGCompilationMode.cpp in Sources */,
+                               A1B9E23B1B4E0D6700BC7FED /* IntlCollatorConstructor.cpp in Sources */,
                                0F3B3A1A153E68F2003ED0FF /* DFGConstantFoldingPhase.cpp in Sources */,
                                0FBE0F7216C1DB030082C5E8 /* DFGCPSRethreadingPhase.cpp in Sources */,
                                A7D89CF517A0B8CC00773AD8 /* DFGCriticalEdgeBreakingPhase.cpp in Sources */,
                                A7D89CFB17A0B8CC00773AD8 /* DFGLivenessAnalysisPhase.cpp in Sources */,
                                0FF0F19916B729F6005DF95B /* DFGLongLivedState.cpp in Sources */,
                                A767B5B517A0B9650063D940 /* DFGLoopPreHeaderCreationPhase.cpp in Sources */,
+                               A1B9E23D1B4E0D6700BC7FED /* IntlCollatorPrototype.cpp in Sources */,
                                0F2BDC4D1522818600CD8910 /* DFGMinifiedNode.cpp in Sources */,
                                A737810D1799EA2E00817533 /* DFGNaturalLoops.cpp in Sources */,
                                0FF0F19C16B72A03005DF95B /* DFGNode.cpp in Sources */,
                                2AF7382C18BBBF92008A5A37 /* StructureIDTable.cpp in Sources */,
                                A5FD0081189B191A00633231 /* InspectorConsoleAgent.cpp in Sources */,
                                A57D23E51890CEBF0031C7FA /* InspectorDebuggerAgent.cpp in Sources */,
+                               A1587D6F1B4DC14100D69849 /* IntlDateTimeFormatConstructor.cpp in Sources */,
                                A532438718568335002ED692 /* InspectorBackendDispatchers.cpp in Sources */,
                                709FB8691AE335C60039D069 /* WeakSetConstructor.cpp in Sources */,
                                A532438918568335002ED692 /* InspectorFrontendDispatchers.cpp in Sources */,
                                BCDD51EB0FB8DF74004A8BDC /* JITOpcodes.cpp in Sources */,
                                A71236E51195F33C00BD2174 /* JITOpcodes32_64.cpp in Sources */,
                                0F6E845A19030BEF00562741 /* DFGVariableAccessData.cpp in Sources */,
+                               A1587D6D1B4DC14100D69849 /* IntlDateTimeFormat.cpp in Sources */,
                                0F24E54C17EE274900ABB217 /* JITOperations.cpp in Sources */,
                                86CC85C40EE7A89400288682 /* JITPropertyAccess.cpp in Sources */,
                                A7C1E8E4112E72EF00A37F98 /* JITPropertyAccess32_64.cpp in Sources */,
                                0F4680CC14BBB17A00BFE272 /* LowLevelInterpreter.cpp in Sources */,
                                14B723B212D7DA46003BD5ED /* MachineStackMarker.cpp in Sources */,
                                0FEB3ECF16237F6C00AB67AD /* MacroAssembler.cpp in Sources */,
+                               A1D793001B43864B004516F5 /* IntlNumberFormatPrototype.cpp in Sources */,
                                86C568E011A213EE0007F7F0 /* MacroAssemblerARM.cpp in Sources */,
                                A729009C17976C6000317298 /* MacroAssemblerARMv7.cpp in Sources */,
                                A53CE08518BC1A5600BEDF76 /* ConsolePrototype.cpp in Sources */,
                                A5BA15E9182340B300A82E69 /* RemoteInspector.mm in Sources */,
                                2ADFA26318EF3540004F9FCC /* GCLogging.cpp in Sources */,
                                A594558F18245EFD00CC3843 /* RemoteInspectorDebuggable.cpp in Sources */,
+                               A1D792FE1B43864B004516F5 /* IntlNumberFormatConstructor.cpp in Sources */,
                                A5BA15EC182340B400A82E69 /* RemoteInspectorDebuggableConnection.mm in Sources */,
                                A5BA15EE182340B400A82E69 /* RemoteInspectorXPCConnection.mm in Sources */,
                                0F24E55017EE274900ABB217 /* Repatch.cpp in Sources */,
                                0F7700921402FF3C0078EB39 /* SamplingCounter.cpp in Sources */,
                                1429D8850ED21C3D00B89619 /* SamplingTool.cpp in Sources */,
                                70EC0EC61AA0D7DA00B6AAFA /* StringIteratorPrototype.cpp in Sources */,
+                               A1B9E2391B4E0D6700BC7FED /* IntlCollator.cpp in Sources */,
                                A5FD0067189AFE9C00633231 /* ScriptArguments.cpp in Sources */,
                                A5FD006D189B00AA00633231 /* ScriptCallFrame.cpp in Sources */,
                                0F04396D1B03DC0B009598B7 /* DFGCombinedLiveness.cpp in Sources */,
                                0FA2C17B17D7CF84009D015F /* TestRunnerUtils.cpp in Sources */,
                                A7386555118697B400540279 /* ThunkGenerators.cpp in Sources */,
                                0F2B670717B6B5AB00A7AE3F /* TypedArrayController.cpp in Sources */,
+                               A1D792FC1B43864B004516F5 /* IntlNumberFormat.cpp in Sources */,
+                               A1587D711B4DC14100D69849 /* IntlDateTimeFormatPrototype.cpp in Sources */,
                                0F2B670A17B6B5AB00A7AE3F /* TypedArrayType.cpp in Sources */,
                                52C952B919A28A1C0069B386 /* TypeProfiler.cpp in Sources */,
                                0FF4274A158EBE91004CB9FF /* udis86.c in Sources */,
index 432fb6c..6efcd4c 100644 (file)
@@ -33,7 +33,9 @@
     macro(ArrayIterator) \
     macro(BYTES_PER_ELEMENT) \
     macro(Boolean) \
+    macro(Collator) \
     macro(Date) \
+    macro(DateTimeFormat) \
     macro(Error) \
     macro(EvalError) \
     macro(Function) \
@@ -45,6 +47,7 @@
     macro(Math) \
     macro(NaN) \
     macro(Number) \
+    macro(NumberFormat) \
     macro(Object) \
     macro(Promise) \
     macro(RangeError) \
index d6329fd..ee656a3 100644 (file)
@@ -53,7 +53,6 @@ using namespace WTF;
 namespace JSC {
 
 EncodedJSValue JSC_HOST_CALL dateParse(ExecState*);
-EncodedJSValue JSC_HOST_CALL dateNow(ExecState*);
 EncodedJSValue JSC_HOST_CALL dateUTC(ExecState*);
 
 }
index 054f571..cdac97d 100644 (file)
@@ -59,6 +59,8 @@ private:
 
 JSObject* constructDate(ExecState*, JSGlobalObject*, const ArgList&);
 
+EncodedJSValue JSC_HOST_CALL dateNow(ExecState*);
+
 } // namespace JSC
 
 #endif // DateConstructor_h
diff --git a/Source/JavaScriptCore/runtime/IntlCollator.cpp b/Source/JavaScriptCore/runtime/IntlCollator.cpp
new file mode 100644 (file)
index 0000000..98108fc
--- /dev/null
@@ -0,0 +1,122 @@
+/*
+ * Copyright (C) 2015 Andy VanWagoner (thetalecrafter@gmail.com)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "IntlCollator.h"
+
+#if ENABLE(INTL)
+
+#include "Error.h"
+#include "IntlCollatorConstructor.h"
+#include "IntlObject.h"
+#include "JSBoundFunction.h"
+#include "JSCJSValueInlines.h"
+#include "JSCellInlines.h"
+#include "SlotVisitorInlines.h"
+#include "StructureInlines.h"
+
+namespace JSC {
+
+const ClassInfo IntlCollator::s_info = { "Object", &Base::s_info, 0, CREATE_METHOD_TABLE(IntlCollator) };
+
+IntlCollator* IntlCollator::create(VM& vm, IntlCollatorConstructor* constructor)
+{
+    IntlCollator* format = new (NotNull, allocateCell<IntlCollator>(vm.heap)) IntlCollator(vm, constructor->collatorStructure());
+    format->finishCreation(vm);
+    return format;
+}
+
+Structure* IntlCollator::createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype)
+{
+    return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info());
+}
+
+IntlCollator::IntlCollator(VM& vm, Structure* structure)
+    : JSDestructibleObject(vm, structure)
+{
+}
+
+void IntlCollator::finishCreation(VM& vm)
+{
+    Base::finishCreation(vm);
+    ASSERT(inherits(info()));
+}
+
+void IntlCollator::destroy(JSCell* cell)
+{
+    static_cast<IntlCollator*>(cell)->IntlCollator::~IntlCollator();
+}
+
+void IntlCollator::visitChildren(JSCell* cell, SlotVisitor& visitor)
+{
+    IntlCollator* thisObject = jsCast<IntlCollator*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+
+    Base::visitChildren(thisObject, visitor);
+
+    visitor.append(&thisObject->m_boundCompare);
+}
+
+void IntlCollator::setBoundCompare(VM& vm, JSBoundFunction* format)
+{
+    m_boundCompare.set(vm, this, format);
+}
+
+EncodedJSValue JSC_HOST_CALL IntlCollatorFuncCompare(ExecState* exec)
+{
+    // 10.3.4 Collator Compare Functions (ECMA-402 2.0)
+    // 1. Let collator be the this value.
+    IntlCollator* collator = jsDynamicCast<IntlCollator*>(exec->thisValue());
+
+    // 2. Assert: Type(collator) is Object and collator has an [[initializedCollator]] internal slot whose value is true.
+    if (!collator)
+        return JSValue::encode(throwTypeError(exec));
+
+    // 3. If x is not provided, let x be undefined.
+    // 4. If y is not provided, let y be undefined.
+    // 5. Let X be ToString(x).
+    JSString* a = exec->argument(0).toString(exec);
+    // 6. ReturnIfAbrupt(X).
+    if (exec->hadException())
+        return JSValue::encode(jsUndefined());
+
+    // 7. Let Y be ToString(y).
+    JSString* b = exec->argument(1).toString(exec);
+    // 8. ReturnIfAbrupt(Y).
+    if (exec->hadException())
+        return JSValue::encode(jsUndefined());
+
+    // 9. Return CompareStrings(collator, X, Y).
+
+    // 10.3.4 CompareStrings abstract operation (ECMA-402 2.0)
+    // FIXME: Implement CompareStrings.
+
+    // Return simple check until properly implemented.
+    return JSValue::encode(jsNumber(codePointCompare(a->value(exec).impl(), b->value(exec).impl())));
+}
+
+} // namespace JSC
+
+#endif // ENABLE(INTL)
diff --git a/Source/JavaScriptCore/runtime/IntlCollator.h b/Source/JavaScriptCore/runtime/IntlCollator.h
new file mode 100644 (file)
index 0000000..ff22514
--- /dev/null
@@ -0,0 +1,66 @@
+/*
+ * Copyright (C) 2015 Andy VanWagoner (thetalecrafter@gmail.com)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef IntlCollator_h
+#define IntlCollator_h
+
+#if ENABLE(INTL)
+
+#include "JSDestructibleObject.h"
+
+namespace JSC {
+
+class IntlCollatorConstructor;
+class JSBoundFunction;
+
+class IntlCollator : public JSDestructibleObject {
+public:
+    typedef JSDestructibleObject Base;
+
+    static IntlCollator* create(VM&, IntlCollatorConstructor*);
+    static Structure* createStructure(VM&, JSGlobalObject*, JSValue);
+
+    DECLARE_INFO;
+
+    JSBoundFunction* boundCompare() const { return m_boundCompare.get(); }
+    void setBoundCompare(VM&, JSBoundFunction*);
+
+protected:
+    IntlCollator(VM&, Structure*);
+    void finishCreation(VM&);
+    static void destroy(JSCell*);
+    static void visitChildren(JSCell*, SlotVisitor&);
+
+private:
+    WriteBarrier<JSBoundFunction> m_boundCompare;
+};
+    
+EncodedJSValue JSC_HOST_CALL IntlCollatorFuncCompare(ExecState*);
+
+} // namespace JSC
+
+#endif // ENABLE(INTL)
+
+#endif // IntlCollator_h
diff --git a/Source/JavaScriptCore/runtime/IntlCollatorConstructor.cpp b/Source/JavaScriptCore/runtime/IntlCollatorConstructor.cpp
new file mode 100644 (file)
index 0000000..d41dd17
--- /dev/null
@@ -0,0 +1,184 @@
+/*
+ * Copyright (C) 2015 Andy VanWagoner (thetalecrafter@gmail.com)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+#include "config.h"
+#include "IntlCollatorConstructor.h"
+
+#if ENABLE(INTL)
+
+#include "Error.h"
+#include "IntlCollator.h"
+#include "IntlCollatorPrototype.h"
+#include "IntlObject.h"
+#include "JSCJSValueInlines.h"
+#include "JSCellInlines.h"
+#include "Lookup.h"
+#include "SlotVisitorInlines.h"
+#include "StructureInlines.h"
+
+namespace JSC {
+
+STATIC_ASSERT_IS_TRIVIALLY_DESTRUCTIBLE(IntlCollatorConstructor);
+
+static EncodedJSValue JSC_HOST_CALL IntlCollatorConstructorFuncSupportedLocalesOf(ExecState*);
+
+}
+
+#include "IntlCollatorConstructor.lut.h"
+
+namespace JSC {
+
+const ClassInfo IntlCollatorConstructor::s_info = { "Function", &InternalFunction::s_info, &collatorConstructorTable, CREATE_METHOD_TABLE(IntlCollatorConstructor) };
+
+/* Source for IntlCollatorConstructor.lut.h
+@begin collatorConstructorTable
+  supportedLocalesOf             IntlCollatorConstructorFuncSupportedLocalesOf             DontEnum|Function 1
+@end
+*/
+
+IntlCollatorConstructor* IntlCollatorConstructor::create(VM& vm, Structure* structure, IntlCollatorPrototype* collatorPrototype, Structure* collatorStructure)
+{
+    IntlCollatorConstructor* constructor = new (NotNull, allocateCell<IntlCollatorConstructor>(vm.heap)) IntlCollatorConstructor(vm, structure);
+    constructor->finishCreation(vm, collatorPrototype, collatorStructure);
+    return constructor;
+}
+
+Structure* IntlCollatorConstructor::createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype)
+{
+    return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info());
+}
+
+IntlCollatorConstructor::IntlCollatorConstructor(VM& vm, Structure* structure)
+    : InternalFunction(vm, structure)
+{
+}
+
+void IntlCollatorConstructor::finishCreation(VM& vm, IntlCollatorPrototype* collatorPrototype, Structure* collatorStructure)
+{
+    Base::finishCreation(vm, ASCIILiteral("Collator"));
+    putDirectWithoutTransition(vm, vm.propertyNames->prototype, collatorPrototype, DontEnum | DontDelete | ReadOnly);
+    putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(0), ReadOnly | DontEnum | DontDelete);
+    m_collatorStructure.set(vm, this, collatorStructure);
+}
+
+EncodedJSValue JSC_HOST_CALL constructIntlCollator(ExecState* exec)
+{
+    // 10.1.2 Intl.Collator ([locales [, options]]) (ECMA-402 2.0)
+    // 1. If NewTarget is undefined, let newTarget be the active function object, else let newTarget be NewTarget.
+    JSValue newTarget = exec->newTarget();
+    if (!newTarget || newTarget.isUndefined())
+        newTarget = exec->callee();
+
+    // 2. Let collator be OrdinaryCreateFromConstructor(newTarget, %CollatorPrototype%).
+    VM& vm = exec->vm();
+    IntlCollator* collator = IntlCollator::create(vm, jsCast<IntlCollatorConstructor*>(exec->callee()));
+    if (collator && !jsDynamicCast<IntlCollatorConstructor*>(newTarget)) {
+        JSValue proto = asObject(newTarget)->getDirect(vm, vm.propertyNames->prototype);
+        asObject(collator)->setPrototypeWithCycleCheck(exec, proto);
+    }
+
+    // 3. ReturnIfAbrupt(collator).
+    ASSERT(collator);
+
+    // 4. Return InitializeCollator(collator, locales, options).
+    // FIXME: return JSValue::encode(InitializeCollator(collator, locales, options));
+
+    return JSValue::encode(collator);
+}
+
+EncodedJSValue JSC_HOST_CALL callIntlCollator(ExecState* exec)
+{
+    // 10.1.2 Intl.Collator ([locales [, options]]) (ECMA-402 2.0)
+    // 1. If NewTarget is undefined, let newTarget be the active function object, else let newTarget be NewTarget.
+    // NewTarget is always undefined when called as a function.
+
+    // 2. Let collator be OrdinaryCreateFromConstructor(newTarget, %CollatorPrototype%).
+    VM& vm = exec->vm();
+    IntlCollator* collator = IntlCollator::create(vm, jsCast<IntlCollatorConstructor*>(exec->callee()));
+
+    // 3. ReturnIfAbrupt(collator).
+    ASSERT(collator);
+
+    // 4. Return InitializeCollator(collator, locales, options).
+    // FIXME: return JSValue::encode(InitializeCollator(collator, locales, options));
+
+    return JSValue::encode(collator);
+}
+
+ConstructType IntlCollatorConstructor::getConstructData(JSCell*, ConstructData& constructData)
+{
+    constructData.native.function = constructIntlCollator;
+    return ConstructTypeHost;
+}
+
+CallType IntlCollatorConstructor::getCallData(JSCell*, CallData& callData)
+{
+    callData.native.function = callIntlCollator;
+    return CallTypeHost;
+}
+
+bool IntlCollatorConstructor::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
+{
+    return getStaticFunctionSlot<InternalFunction>(exec, collatorConstructorTable, jsCast<IntlCollatorConstructor*>(object), propertyName, slot);
+}
+
+EncodedJSValue JSC_HOST_CALL IntlCollatorConstructorFuncSupportedLocalesOf(ExecState* exec)
+{
+    // 10.2.2 Intl.Collator.supportedLocalesOf(locales [, options]) (ECMA-402 2.0)
+
+    // 1. Let requestedLocales be CanonicalizeLocaleList(locales).
+    // FIXME: requested = CanonicalizeLocaleList(locales);
+
+    // 2. ReturnIfAbrupt(requestedLocales).
+    // if (exec->hadException())
+    //     return JSValue::encode(jsUndefined());
+
+    // 3. Return SupportedLocales(%Collator%.[[availableLocales]], requestedLocales, options).
+    // FIXME: return JSValue::encode(SupportedLocales(available, requested, options));
+
+    // Return empty array until properly implemented.
+    VM& vm = exec->vm();
+    JSGlobalObject* globalObject = exec->callee()->globalObject();
+    JSArray* supportedLocales = JSArray::tryCreateUninitialized(vm, globalObject->arrayStructureForIndexingTypeDuringAllocation(ArrayWithUndecided), 0);
+    if (!supportedLocales)
+        return JSValue::encode(throwOutOfMemoryError(exec));
+
+    return JSValue::encode(supportedLocales);
+}
+    
+void IntlCollatorConstructor::visitChildren(JSCell* cell, SlotVisitor& visitor)
+{
+    IntlCollatorConstructor* thisObject = jsCast<IntlCollatorConstructor*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+
+    Base::visitChildren(thisObject, visitor);
+
+    visitor.append(&thisObject->m_collatorStructure);
+}
+
+} // namespace JSC
+
+#endif // ENABLE(INTL)
diff --git a/Source/JavaScriptCore/runtime/IntlCollatorConstructor.h b/Source/JavaScriptCore/runtime/IntlCollatorConstructor.h
new file mode 100644 (file)
index 0000000..4aa98f2
--- /dev/null
@@ -0,0 +1,70 @@
+/*
+ * Copyright (C) 2015 Andy VanWagoner (thetalecrafter@gmail.com)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef IntlCollatorConstructor_h
+#define IntlCollatorConstructor_h
+
+#if ENABLE(INTL)
+
+#include "InternalFunction.h"
+
+namespace JSC {
+
+class IntlCollator;
+class IntlCollatorPrototype;
+
+class IntlCollatorConstructor : public InternalFunction {
+public:
+    typedef InternalFunction Base;
+    static const unsigned StructureFlags = Base::StructureFlags | OverridesGetOwnPropertySlot;
+
+    static IntlCollatorConstructor* create(VM&, Structure*, IntlCollatorPrototype*, Structure*);
+    static Structure* createStructure(VM&, JSGlobalObject*, JSValue);
+
+    DECLARE_INFO;
+
+    Structure* collatorStructure() const { return m_collatorStructure.get(); }
+
+protected:
+    void finishCreation(VM&, IntlCollatorPrototype*, Structure*);
+
+private:
+    IntlCollatorConstructor(VM&, Structure*);
+    static ConstructType getConstructData(JSCell*, ConstructData&);
+    static CallType getCallData(JSCell*, CallData&);
+    static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&);
+    static void visitChildren(JSCell*, SlotVisitor&);
+    
+    WriteBarrier<Structure> m_collatorStructure;
+};
+
+EncodedJSValue JSC_HOST_CALL constructIntlCollator(ExecState*);
+EncodedJSValue JSC_HOST_CALL callIntlCollator(ExecState*);
+
+} // namespace JSC
+
+#endif // ENABLE(INTL)
+
+#endif // IntlCollatorConstructor_h
diff --git a/Source/JavaScriptCore/runtime/IntlCollatorPrototype.cpp b/Source/JavaScriptCore/runtime/IntlCollatorPrototype.cpp
new file mode 100644 (file)
index 0000000..d46ddbf
--- /dev/null
@@ -0,0 +1,136 @@
+/*
+ * Copyright (C) 2015 Andy VanWagoner (thetalecrafter@gmail.com)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "IntlCollatorPrototype.h"
+
+#if ENABLE(INTL)
+
+#include "Error.h"
+#include "IntlCollator.h"
+#include "JSBoundFunction.h"
+#include "JSCJSValueInlines.h"
+#include "JSCellInlines.h"
+#include "JSObject.h"
+#include "ObjectConstructor.h"
+#include "StructureInlines.h"
+
+namespace JSC {
+
+STATIC_ASSERT_IS_TRIVIALLY_DESTRUCTIBLE(IntlCollatorPrototype);
+
+static EncodedJSValue JSC_HOST_CALL IntlCollatorPrototypeGetterCompare(ExecState*);
+static EncodedJSValue JSC_HOST_CALL IntlCollatorPrototypeFuncResolvedOptions(ExecState*);
+
+}
+
+#include "IntlCollatorPrototype.lut.h"
+
+namespace JSC {
+
+const ClassInfo IntlCollatorPrototype::s_info = { "Object", &IntlCollator::s_info, &collatorPrototypeTable, CREATE_METHOD_TABLE(IntlCollatorPrototype) };
+
+/* Source for IntlCollatorPrototype.lut.h
+@begin collatorPrototypeTable
+  compare          IntlCollatorPrototypeGetterCompare        DontEnum|Accessor
+  resolvedOptions  IntlCollatorPrototypeFuncResolvedOptions  DontEnum|Function 0
+@end
+*/
+
+IntlCollatorPrototype* IntlCollatorPrototype::create(VM& vm, JSGlobalObject*, Structure* structure)
+{
+    IntlCollatorPrototype* object = new (NotNull, allocateCell<IntlCollatorPrototype>(vm.heap)) IntlCollatorPrototype(vm, structure);
+    object->finishCreation(vm);
+    return object;
+}
+
+Structure* IntlCollatorPrototype::createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype)
+{
+    return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info());
+}
+
+IntlCollatorPrototype::IntlCollatorPrototype(VM& vm, Structure* structure)
+    : IntlCollator(vm, structure)
+{
+}
+
+void IntlCollatorPrototype::finishCreation(VM& vm)
+{
+    Base::finishCreation(vm);
+}
+
+bool IntlCollatorPrototype::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
+{
+    return getStaticFunctionSlot<JSObject>(exec, collatorPrototypeTable, jsCast<IntlCollatorPrototype*>(object), propertyName, slot);
+}
+
+EncodedJSValue JSC_HOST_CALL IntlCollatorPrototypeGetterCompare(ExecState* exec)
+{
+    // 10.3.3 Intl.Collator.prototype.compare (ECMA-402 2.0)
+    // 1. Let collator be this Collator object.
+    IntlCollator* collator = jsDynamicCast<IntlCollator*>(exec->thisValue());
+    if (!collator)
+        return JSValue::encode(throwTypeError(exec, ASCIILiteral("Intl.Collator.prototype.compare called on value that's not an object initialized as a Collator")));
+
+    JSBoundFunction* boundCompare = collator->boundCompare();
+    // 2. If collator.[[boundCompare]] is undefined,
+    if (!boundCompare) {
+        VM& vm = exec->vm();
+        JSGlobalObject* globalObject = collator->globalObject();
+        // a. Let F be a new built-in function object as defined in 11.3.4.
+        // b. The value of F’s length property is 2.
+        JSFunction* targetObject = JSFunction::create(vm, globalObject, 2, ASCIILiteral("compare"), IntlCollatorFuncCompare, NoIntrinsic);
+        JSArray* boundArgs = JSArray::tryCreateUninitialized(vm, globalObject->arrayStructureForIndexingTypeDuringAllocation(ArrayWithUndecided), 0);
+        if (!boundArgs)
+            return JSValue::encode(throwOutOfMemoryError(exec));
+
+        // c. Let bc be BoundFunctionCreate(F, «this value»).
+        boundCompare = JSBoundFunction::create(vm, globalObject, targetObject, collator, boundArgs, 2, ASCIILiteral("compare"));
+        // d. Set collator.[[boundCompare]] to bc.
+        collator->setBoundCompare(vm, boundCompare);
+    }
+    // 3. Return collator.[[boundCompare]].
+    return JSValue::encode(boundCompare);
+}
+
+EncodedJSValue JSC_HOST_CALL IntlCollatorPrototypeFuncResolvedOptions(ExecState* exec)
+{
+    // 10.3.5 Intl.Collator.prototype.resolvedOptions() (ECMA-402 2.0)
+    IntlCollator* collator = jsDynamicCast<IntlCollator*>(exec->thisValue());
+    if (!collator)
+        return JSValue::encode(throwTypeError(exec, ASCIILiteral("Intl.Collator.prototype.resolvedOptions called on value that's not an object initialized as a Collator")));
+
+    // The function returns a new object whose properties and attributes are set as if constructed by an object literal assigning to each of the following properties the value of the corresponding internal slot of this Collator object (see 10.4): locale, usage, sensitivity, ignorePunctuation, collation, as well as those properties shown in Table 1 whose keys are included in the %Collator%[[relevantExtensionKeys]] internal slot of the standard built-in object that is the initial value of Intl.Collator.
+
+    JSObject* options = constructEmptyObject(exec);
+
+    // FIXME: Populate object from internal slots.
+
+    return JSValue::encode(options);
+}
+
+} // namespace JSC
+
+#endif // ENABLE(INTL)
diff --git a/Source/JavaScriptCore/runtime/IntlCollatorPrototype.h b/Source/JavaScriptCore/runtime/IntlCollatorPrototype.h
new file mode 100644 (file)
index 0000000..f816426
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2015 Andy VanWagoner (thetalecrafter@gmail.com)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef IntlCollatorPrototype_h
+#define IntlCollatorPrototype_h
+
+#if ENABLE(INTL)
+
+#include "IntlCollator.h"
+#include "JSObject.h"
+
+namespace JSC {
+
+class IntlCollatorPrototype : public IntlCollator {
+public:
+    typedef IntlCollator Base;
+    static const unsigned StructureFlags = Base::StructureFlags | OverridesGetOwnPropertySlot;
+
+    static IntlCollatorPrototype* create(VM&, JSGlobalObject*, Structure*);
+    static Structure* createStructure(VM&, JSGlobalObject*, JSValue);
+
+    DECLARE_INFO;
+
+protected:
+    void finishCreation(VM&);
+
+private:
+    IntlCollatorPrototype(VM&, Structure*);
+    static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&);
+};
+
+} // namespace JSC
+
+#endif // ENABLE(INTL)
+
+#endif // IntlCollatorPrototype_h
diff --git a/Source/JavaScriptCore/runtime/IntlDateTimeFormat.cpp b/Source/JavaScriptCore/runtime/IntlDateTimeFormat.cpp
new file mode 100644 (file)
index 0000000..7839bad
--- /dev/null
@@ -0,0 +1,133 @@
+/*
+ * Copyright (C) 2015 Andy VanWagoner (thetalecrafter@gmail.com)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "IntlDateTimeFormat.h"
+
+#if ENABLE(INTL)
+
+#include "DateConstructor.h"
+#include "DateInstance.h"
+#include "Error.h"
+#include "IntlDateTimeFormatConstructor.h"
+#include "IntlObject.h"
+#include "JSBoundFunction.h"
+#include "JSCJSValueInlines.h"
+#include "JSCellInlines.h"
+#include "SlotVisitorInlines.h"
+#include "StructureInlines.h"
+
+namespace JSC {
+
+const ClassInfo IntlDateTimeFormat::s_info = { "Object", &Base::s_info, 0, CREATE_METHOD_TABLE(IntlDateTimeFormat) };
+
+IntlDateTimeFormat* IntlDateTimeFormat::create(VM& vm, IntlDateTimeFormatConstructor* constructor)
+{
+    IntlDateTimeFormat* format = new (NotNull, allocateCell<IntlDateTimeFormat>(vm.heap)) IntlDateTimeFormat(vm, constructor->dateTimeFormatStructure());
+    format->finishCreation(vm);
+    return format;
+}
+
+Structure* IntlDateTimeFormat::createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype)
+{
+    return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info());
+}
+
+IntlDateTimeFormat::IntlDateTimeFormat(VM& vm, Structure* structure)
+    : JSDestructibleObject(vm, structure)
+{
+}
+
+void IntlDateTimeFormat::finishCreation(VM& vm)
+{
+    Base::finishCreation(vm);
+    ASSERT(inherits(info()));
+}
+
+void IntlDateTimeFormat::destroy(JSCell* cell)
+{
+    static_cast<IntlDateTimeFormat*>(cell)->IntlDateTimeFormat::~IntlDateTimeFormat();
+}
+
+void IntlDateTimeFormat::visitChildren(JSCell* cell, SlotVisitor& visitor)
+{
+    IntlDateTimeFormat* thisObject = jsCast<IntlDateTimeFormat*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+
+    Base::visitChildren(thisObject, visitor);
+
+    visitor.append(&thisObject->m_boundFormat);
+}
+
+void IntlDateTimeFormat::setBoundFormat(VM& vm, JSBoundFunction* format)
+{
+    m_boundFormat.set(vm, this, format);
+}
+
+EncodedJSValue JSC_HOST_CALL IntlDateTimeFormatFuncFormatDateTime(ExecState* exec)
+{
+    // 12.3.4 DateTime Format Functions (ECMA-402 2.0)
+    // 1. Let dtf be the this value.
+    IntlDateTimeFormat* format = jsDynamicCast<IntlDateTimeFormat*>(exec->thisValue());
+    // 2. Assert: Type(dtf) is Object and dtf has an [[initializedDateTimeFormat]] internal slot whose value is true.
+    if (!format)
+        return JSValue::encode(throwTypeError(exec));
+
+    JSValue date = exec->argument(0);
+    double value;
+
+    // 3. If date is not provided or is undefined, then
+    if (date.isUndefined()) {
+        // a. Let x be %Date_now%().
+        value = JSValue::decode(dateNow(exec)).toNumber(exec);
+    } else {
+        // 4. Else
+        // a. Let x be ToNumber(date).
+        value = date.toNumber(exec);
+        // b. ReturnIfAbrupt(x).
+        if (exec->hadException())
+            return JSValue::encode(jsUndefined());
+    }
+
+    // 5. Return FormatDateTime(dtf, x).
+
+    // 12.3.4 FormatDateTime abstract operation (ECMA-402 2.0)
+
+    // 1. If x is not a finite Number, then throw a RangeError exception.
+    if (!std::isfinite(value))
+        return JSValue::encode(throwRangeError(exec, ASCIILiteral("date value is not finite in DateTimeFormat.format()")));
+
+    // FIXME: implement 2 - 9
+
+    // Return new Date(value).toString() until properly implemented.
+    VM& vm = exec->vm();
+    JSGlobalObject* globalObject = exec->callee()->globalObject();
+    DateInstance* d = DateInstance::create(vm, globalObject->dateStructure(), value);
+    return JSValue::encode(JSValue(d).toString(exec));
+}
+
+} // namespace JSC
+
+#endif // ENABLE(INTL)
diff --git a/Source/JavaScriptCore/runtime/IntlDateTimeFormat.h b/Source/JavaScriptCore/runtime/IntlDateTimeFormat.h
new file mode 100644 (file)
index 0000000..7daed13
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2015 Andy VanWagoner (thetalecrafter@gmail.com)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef IntlDateTimeFormat_h
+#define IntlDateTimeFormat_h
+
+#if ENABLE(INTL)
+
+#include "JSDestructibleObject.h"
+
+namespace JSC {
+
+class IntlDateTimeFormatConstructor;
+class JSBoundFunction;
+
+class IntlDateTimeFormat : public JSDestructibleObject {
+public:
+    typedef JSDestructibleObject Base;
+
+    static IntlDateTimeFormat* create(VM&, IntlDateTimeFormatConstructor*);
+    static Structure* createStructure(VM&, JSGlobalObject*, JSValue);
+
+    DECLARE_INFO;
+
+    JSBoundFunction* boundFormat() const { return m_boundFormat.get(); }
+    void setBoundFormat(VM&, JSBoundFunction*);
+
+protected:
+    IntlDateTimeFormat(VM&, Structure*);
+    void finishCreation(VM&);
+    static void destroy(JSCell*);
+    static void visitChildren(JSCell*, SlotVisitor&);
+
+    WriteBarrier<JSBoundFunction> m_boundFormat;
+};
+    
+EncodedJSValue JSC_HOST_CALL IntlDateTimeFormatFuncFormatDateTime(ExecState*);
+
+} // namespace JSC
+
+#endif // ENABLE(INTL)
+
+#endif // IntlDateTimeFormat_h
diff --git a/Source/JavaScriptCore/runtime/IntlDateTimeFormatConstructor.cpp b/Source/JavaScriptCore/runtime/IntlDateTimeFormatConstructor.cpp
new file mode 100644 (file)
index 0000000..0b8d460
--- /dev/null
@@ -0,0 +1,183 @@
+/*
+ * Copyright (C) 2015 Andy VanWagoner (thetalecrafter@gmail.com)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+#include "config.h"
+#include "IntlDateTimeFormatConstructor.h"
+
+#if ENABLE(INTL)
+
+#include "Error.h"
+#include "IntlDateTimeFormat.h"
+#include "IntlDateTimeFormatPrototype.h"
+#include "IntlObject.h"
+#include "JSCJSValueInlines.h"
+#include "JSCellInlines.h"
+#include "Lookup.h"
+#include "SlotVisitorInlines.h"
+#include "StructureInlines.h"
+
+namespace JSC {
+
+STATIC_ASSERT_IS_TRIVIALLY_DESTRUCTIBLE(IntlDateTimeFormatConstructor);
+
+static EncodedJSValue JSC_HOST_CALL IntlDateTimeFormatConstructorFuncSupportedLocalesOf(ExecState*);
+
+}
+
+#include "IntlDateTimeFormatConstructor.lut.h"
+
+namespace JSC {
+
+const ClassInfo IntlDateTimeFormatConstructor::s_info = { "Function", &InternalFunction::s_info, &dateTimeFormatConstructorTable, CREATE_METHOD_TABLE(IntlDateTimeFormatConstructor) };
+
+/* Source for IntlDateTimeFormatConstructor.lut.h
+@begin dateTimeFormatConstructorTable
+  supportedLocalesOf             IntlDateTimeFormatConstructorFuncSupportedLocalesOf             DontEnum|Function 1
+@end
+*/
+
+IntlDateTimeFormatConstructor* IntlDateTimeFormatConstructor::create(VM& vm, Structure* structure, IntlDateTimeFormatPrototype* dateTimeFormatPrototype, Structure* dateTimeFormatStructure)
+{
+    IntlDateTimeFormatConstructor* constructor = new (NotNull, allocateCell<IntlDateTimeFormatConstructor>(vm.heap)) IntlDateTimeFormatConstructor(vm, structure);
+    constructor->finishCreation(vm, dateTimeFormatPrototype, dateTimeFormatStructure);
+    return constructor;
+}
+
+Structure* IntlDateTimeFormatConstructor::createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype)
+{
+    return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info());
+}
+
+IntlDateTimeFormatConstructor::IntlDateTimeFormatConstructor(VM& vm, Structure* structure)
+    : InternalFunction(vm, structure)
+{
+}
+
+void IntlDateTimeFormatConstructor::finishCreation(VM& vm, IntlDateTimeFormatPrototype* dateTimeFormatPrototype, Structure* dateTimeFormatStructure)
+{
+    Base::finishCreation(vm, ASCIILiteral("DateTimeFormat"));
+    putDirectWithoutTransition(vm, vm.propertyNames->prototype, dateTimeFormatPrototype, DontEnum | DontDelete | ReadOnly);
+    putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(0), ReadOnly | DontEnum | DontDelete);
+    m_dateTimeFormatStructure.set(vm, this, dateTimeFormatStructure);
+}
+
+EncodedJSValue JSC_HOST_CALL constructIntlDateTimeFormat(ExecState* exec)
+{
+    // 12.1.2 Intl.DateTimeFormat ([locales [, options]]) (ECMA-402 2.0)
+    // 1. If NewTarget is undefined, let newTarget be the active function object, else let newTarget be NewTarget.
+    JSValue newTarget = exec->newTarget();
+    if (!newTarget || newTarget.isUndefined())
+        newTarget = exec->callee();
+
+    // 2. Let dateTimeFormat be OrdinaryCreateFromConstructor(newTarget, %DateTimeFormatPrototype%).
+    VM& vm = exec->vm();
+    IntlDateTimeFormat* dateTimeFormat = IntlDateTimeFormat::create(vm, jsCast<IntlDateTimeFormatConstructor*>(exec->callee()));
+    if (dateTimeFormat && !jsDynamicCast<IntlDateTimeFormatConstructor*>(newTarget)) {
+        JSValue proto = asObject(newTarget)->getDirect(vm, vm.propertyNames->prototype);
+        asObject(dateTimeFormat)->setPrototypeWithCycleCheck(exec, proto);
+    }
+
+    // 3. ReturnIfAbrupt(dateTimeFormat).
+    ASSERT(dateTimeFormat);
+
+    // 4. Return InitializeDateTimeFormat(dateTimeFormat, locales, options).
+    // FIXME: return JSValue::encode(InitializeDateTimeFormat(dateTimeFormat, locales, options));
+
+    return JSValue::encode(dateTimeFormat);
+}
+    
+EncodedJSValue JSC_HOST_CALL callIntlDateTimeFormat(ExecState* exec)
+{
+    // 12.1.2 Intl.DateTimeFormat ([locales [, options]]) (ECMA-402 2.0)
+    // 1. If NewTarget is undefined, let newTarget be the active function object, else let newTarget be NewTarget.
+    // NewTarget is always undefined when called as a function.
+
+    // 2. Let dateTimeFormat be OrdinaryCreateFromConstructor(newTarget, %DateTimeFormatPrototype%).
+    VM& vm = exec->vm();
+    IntlDateTimeFormat* dateTimeFormat = IntlDateTimeFormat::create(vm, jsCast<IntlDateTimeFormatConstructor*>(exec->callee()));
+
+    // 3. ReturnIfAbrupt(dateTimeFormat).
+    ASSERT(dateTimeFormat);
+
+    // 4. Return InitializeDateTimeFormat(dateTimeFormat, locales, options).
+    // FIXME: return JSValue::encode(InitializeDateTimeFormat(dateTimeFormat, locales, options));
+
+    return JSValue::encode(dateTimeFormat);
+}
+
+ConstructType IntlDateTimeFormatConstructor::getConstructData(JSCell*, ConstructData& constructData)
+{
+    constructData.native.function = constructIntlDateTimeFormat;
+    return ConstructTypeHost;
+}
+
+CallType IntlDateTimeFormatConstructor::getCallData(JSCell*, CallData& callData)
+{
+    callData.native.function = callIntlDateTimeFormat;
+    return CallTypeHost;
+}
+
+bool IntlDateTimeFormatConstructor::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
+{
+    return getStaticFunctionSlot<InternalFunction>(exec, dateTimeFormatConstructorTable, jsCast<IntlDateTimeFormatConstructor*>(object), propertyName, slot);
+}
+
+EncodedJSValue JSC_HOST_CALL IntlDateTimeFormatConstructorFuncSupportedLocalesOf(ExecState* exec)
+{
+    // 12.2.2 Intl.DateTimeFormat.supportedLocalesOf(locales [, options]) (ECMA-402 2.0)
+
+    // 1. Let availableLocales be %DateTimeFormat%.[[availableLocales]].
+    // FIXME: available = IntlDateTimeFormatConstructor::getAvailableLocales()
+
+    // 2. Let requestedLocales be CanonicalizeLocaleList(locales).
+    // FIXME: requested = CanonicalizeLocaleList(locales)
+
+    // 3. Return SupportedLocales(availableLocales, requestedLocales, options).
+    // FIXME: return JSValue::encode(SupportedLocales(available, requested, options));
+
+    // Return empty array until properly implemented.
+    VM& vm = exec->vm();
+    JSGlobalObject* globalObject = exec->callee()->globalObject();
+    JSArray* supportedLocales = JSArray::tryCreateUninitialized(vm, globalObject->arrayStructureForIndexingTypeDuringAllocation(ArrayWithUndecided), 0);
+    if (!supportedLocales)
+        return JSValue::encode(throwOutOfMemoryError(exec));
+
+    return JSValue::encode(supportedLocales);
+}
+    
+void IntlDateTimeFormatConstructor::visitChildren(JSCell* cell, SlotVisitor& visitor)
+{
+    IntlDateTimeFormatConstructor* thisObject = jsCast<IntlDateTimeFormatConstructor*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+
+    Base::visitChildren(thisObject, visitor);
+
+    visitor.append(&thisObject->m_dateTimeFormatStructure);
+}
+
+} // namespace JSC
+
+#endif // ENABLE(INTL)
diff --git a/Source/JavaScriptCore/runtime/IntlDateTimeFormatConstructor.h b/Source/JavaScriptCore/runtime/IntlDateTimeFormatConstructor.h
new file mode 100644 (file)
index 0000000..cf043a7
--- /dev/null
@@ -0,0 +1,70 @@
+/*
+ * Copyright (C) 2015 Andy VanWagoner (thetalecrafter@gmail.com)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef IntlDateTimeFormatConstructor_h
+#define IntlDateTimeFormatConstructor_h
+
+#if ENABLE(INTL)
+
+#include "InternalFunction.h"
+
+namespace JSC {
+
+class IntlDateTimeFormat;
+class IntlDateTimeFormatPrototype;
+
+class IntlDateTimeFormatConstructor : public InternalFunction {
+public:
+    typedef InternalFunction Base;
+    static const unsigned StructureFlags = Base::StructureFlags | OverridesGetOwnPropertySlot;
+
+    static IntlDateTimeFormatConstructor* create(VM&, Structure*, IntlDateTimeFormatPrototype*, Structure*);
+    static Structure* createStructure(VM&, JSGlobalObject*, JSValue);
+
+    DECLARE_INFO;
+
+    Structure* dateTimeFormatStructure() const { return m_dateTimeFormatStructure.get(); }
+
+protected:
+    void finishCreation(VM&, IntlDateTimeFormatPrototype*, Structure*);
+
+private:
+    IntlDateTimeFormatConstructor(VM&, Structure*);
+    static ConstructType getConstructData(JSCell*, ConstructData&);
+    static CallType getCallData(JSCell*, CallData&);
+    static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&);
+    static void visitChildren(JSCell*, SlotVisitor&);
+    
+    WriteBarrier<Structure> m_dateTimeFormatStructure;
+};
+
+EncodedJSValue JSC_HOST_CALL constructIntlDateTimeFormat(ExecState*);
+EncodedJSValue JSC_HOST_CALL callIntlDateTimeFormat(ExecState*);
+
+} // namespace JSC
+
+#endif // ENABLE(INTL)
+
+#endif // IntlDateTimeFormatConstructor_h
diff --git a/Source/JavaScriptCore/runtime/IntlDateTimeFormatPrototype.cpp b/Source/JavaScriptCore/runtime/IntlDateTimeFormatPrototype.cpp
new file mode 100644 (file)
index 0000000..079b929
--- /dev/null
@@ -0,0 +1,138 @@
+/*
+ * Copyright (C) 2015 Andy VanWagoner (thetalecrafter@gmail.com)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "IntlDateTimeFormatPrototype.h"
+
+#if ENABLE(INTL)
+
+#include "Error.h"
+#include "IntlDateTimeFormat.h"
+#include "JSBoundFunction.h"
+#include "JSCJSValueInlines.h"
+#include "JSCellInlines.h"
+#include "JSObject.h"
+#include "ObjectConstructor.h"
+#include "StructureInlines.h"
+
+namespace JSC {
+
+STATIC_ASSERT_IS_TRIVIALLY_DESTRUCTIBLE(IntlDateTimeFormatPrototype);
+
+static EncodedJSValue JSC_HOST_CALL IntlDateTimeFormatPrototypeGetterFormat(ExecState*);
+static EncodedJSValue JSC_HOST_CALL IntlDateTimeFormatPrototypeFuncResolvedOptions(ExecState*);
+
+}
+
+#include "IntlDateTimeFormatPrototype.lut.h"
+
+namespace JSC {
+
+const ClassInfo IntlDateTimeFormatPrototype::s_info = { "Object", &IntlDateTimeFormat::s_info, &dateTimeFormatPrototypeTable, CREATE_METHOD_TABLE(IntlDateTimeFormatPrototype) };
+
+/* Source for IntlDateTimeFormatPrototype.lut.h
+@begin dateTimeFormatPrototypeTable
+  format           IntlDateTimeFormatPrototypeGetterFormat         DontEnum|Accessor
+  resolvedOptions  IntlDateTimeFormatPrototypeFuncResolvedOptions  DontEnum|Function 0
+@end
+*/
+
+IntlDateTimeFormatPrototype* IntlDateTimeFormatPrototype::create(VM& vm, JSGlobalObject*, Structure* structure)
+{
+    IntlDateTimeFormatPrototype* object = new (NotNull, allocateCell<IntlDateTimeFormatPrototype>(vm.heap)) IntlDateTimeFormatPrototype(vm, structure);
+    object->finishCreation(vm, structure);
+    return object;
+}
+
+Structure* IntlDateTimeFormatPrototype::createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype)
+{
+    return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info());
+}
+
+IntlDateTimeFormatPrototype::IntlDateTimeFormatPrototype(VM& vm, Structure* structure)
+    : IntlDateTimeFormat(vm, structure)
+{
+}
+
+void IntlDateTimeFormatPrototype::finishCreation(VM& vm, Structure*)
+{
+    Base::finishCreation(vm);
+}
+
+bool IntlDateTimeFormatPrototype::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
+{
+    return getStaticFunctionSlot<JSObject>(exec, dateTimeFormatPrototypeTable, jsCast<IntlDateTimeFormatPrototype*>(object), propertyName, slot);
+}
+
+EncodedJSValue JSC_HOST_CALL IntlDateTimeFormatPrototypeGetterFormat(ExecState* exec)
+{
+    // 12.3.3 Intl.DateTimeFormat.prototype.format (ECMA-402 2.0)
+    // 1. Let dtf be this DateTimeFormat object.
+    IntlDateTimeFormat* dtf = jsDynamicCast<IntlDateTimeFormat*>(exec->thisValue());
+    // 2. ReturnIfAbrupt(dtf).
+    if (!dtf)
+        return JSValue::encode(throwTypeError(exec, ASCIILiteral("Intl.DateTimeFormat.prototype.format called on value that's not an object initialized as a DateTimeFormat")));
+    
+    JSBoundFunction* boundFormat = dtf->boundFormat();
+    // 3. If the [[boundFormat]] internal slot of this DateTimeFormat object is undefined,
+    if (!boundFormat) {
+        VM& vm = exec->vm();
+        JSGlobalObject* globalObject = dtf->globalObject();
+        // a. Let F be a new built-in function object as defined in 12.3.4.
+        // b. The value of F’s length property is 1. (Note: F’s length property was 0 in ECMA-402 1.0)
+        JSFunction* targetObject = JSFunction::create(vm, globalObject, 1, ASCIILiteral("format"), IntlDateTimeFormatFuncFormatDateTime, NoIntrinsic);
+        JSArray* boundArgs = JSArray::tryCreateUninitialized(vm, globalObject->arrayStructureForIndexingTypeDuringAllocation(ArrayWithUndecided), 0);
+        if (!boundArgs)
+            return JSValue::encode(throwOutOfMemoryError(exec));
+        
+        // c. Let bf be BoundFunctionCreate(F, «this value»).
+        boundFormat = JSBoundFunction::create(vm, globalObject, targetObject, dtf, boundArgs, 1, ASCIILiteral("format"));
+        // d. Set dtf.[[boundFormat]] to bf.
+        dtf->setBoundFormat(vm, boundFormat);
+    }
+    // 4. Return dtf.[[boundFormat]].
+    return JSValue::encode(boundFormat);
+}
+
+EncodedJSValue JSC_HOST_CALL IntlDateTimeFormatPrototypeFuncResolvedOptions(ExecState* exec)
+{
+    // 12.3.5 Intl.DateTimeFormat.prototype.resolvedOptions() (ECMA-402 2.0)
+    IntlDateTimeFormat* dtf = jsDynamicCast<IntlDateTimeFormat*>(exec->thisValue());
+    if (!dtf)
+        return JSValue::encode(throwTypeError(exec, ASCIILiteral("Intl.DateTimeFormat.prototype.resolvedOptions called on value that's not an object initialized as a DateTimeFormat")));
+
+    // The function returns a new object whose properties and attributes are set as if constructed by an object literal assigning to each of the following properties the value of the corresponding internal slot of this DateTimeFormat object (see 12.4): locale, calendar, numberingSystem, timeZone, hour12, weekday, era, year, month, day, hour, minute, second, and timeZoneName. Properties whose corresponding internal slots are not present are not assigned.
+    // Note: In this version of the ECMAScript 2015 Internationalization API, the timeZone property will be the name of the default time zone if no timeZone property was provided in the options object provided to the Intl.DateTimeFormat constructor. The previous version left the timeZone property undefined in this case.
+
+    JSObject* options = constructEmptyObject(exec);
+
+    // FIXME: Populate object from internal slots.
+
+    return JSValue::encode(options);
+}
+
+} // namespace JSC
+
+#endif // ENABLE(INTL)
diff --git a/Source/JavaScriptCore/runtime/IntlDateTimeFormatPrototype.h b/Source/JavaScriptCore/runtime/IntlDateTimeFormatPrototype.h
new file mode 100644 (file)
index 0000000..a2fd5e3
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2015 Andy VanWagoner (thetalecrafter@gmail.com)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef IntlDateTimeFormatPrototype_h
+#define IntlDateTimeFormatPrototype_h
+
+#if ENABLE(INTL)
+
+#include "IntlDateTimeFormat.h"
+#include "JSObject.h"
+
+namespace JSC {
+
+class IntlDateTimeFormatPrototype : public IntlDateTimeFormat {
+public:
+    typedef IntlDateTimeFormat Base;
+    static const unsigned StructureFlags = Base::StructureFlags | OverridesGetOwnPropertySlot;
+
+    static IntlDateTimeFormatPrototype* create(VM&, JSGlobalObject*, Structure*);
+    static Structure* createStructure(VM&, JSGlobalObject*, JSValue);
+
+    DECLARE_INFO;
+
+protected:
+    void finishCreation(VM&, Structure*);
+
+private:
+    IntlDateTimeFormatPrototype(VM&, Structure*);
+    static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&);
+};
+
+} // namespace JSC
+
+#endif // ENABLE(INTL)
+
+#endif // IntlDateTimeFormatPrototype_h
diff --git a/Source/JavaScriptCore/runtime/IntlNumberFormat.cpp b/Source/JavaScriptCore/runtime/IntlNumberFormat.cpp
new file mode 100644 (file)
index 0000000..139dc5b
--- /dev/null
@@ -0,0 +1,113 @@
+/*
+ * Copyright (C) 2015 Andy VanWagoner (thetalecrafter@gmail.com)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "IntlNumberFormat.h"
+
+#if ENABLE(INTL)
+
+#include "Error.h"
+#include "IntlNumberFormatConstructor.h"
+#include "IntlObject.h"
+#include "JSBoundFunction.h"
+#include "JSCJSValueInlines.h"
+#include "JSCellInlines.h"
+#include "SlotVisitorInlines.h"
+#include "StructureInlines.h"
+
+namespace JSC {
+
+const ClassInfo IntlNumberFormat::s_info = { "Object", &Base::s_info, 0, CREATE_METHOD_TABLE(IntlNumberFormat) };
+
+IntlNumberFormat* IntlNumberFormat::create(VM& vm, IntlNumberFormatConstructor* constructor)
+{
+    IntlNumberFormat* format = new (NotNull, allocateCell<IntlNumberFormat>(vm.heap)) IntlNumberFormat(vm, constructor->numberFormatStructure());
+    format->finishCreation(vm);
+    return format;
+}
+
+Structure* IntlNumberFormat::createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype)
+{
+    return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info());
+}
+
+IntlNumberFormat::IntlNumberFormat(VM& vm, Structure* structure)
+    : JSDestructibleObject(vm, structure)
+{
+}
+
+void IntlNumberFormat::finishCreation(VM& vm)
+{
+    Base::finishCreation(vm);
+    ASSERT(inherits(info()));
+}
+
+void IntlNumberFormat::destroy(JSCell* cell)
+{
+    static_cast<IntlNumberFormat*>(cell)->IntlNumberFormat::~IntlNumberFormat();
+}
+
+void IntlNumberFormat::visitChildren(JSCell* cell, SlotVisitor& visitor)
+{
+    IntlNumberFormat* thisObject = jsCast<IntlNumberFormat*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+
+    Base::visitChildren(thisObject, visitor);
+
+    visitor.append(&thisObject->m_boundFormat);
+}
+
+void IntlNumberFormat::setBoundFormat(VM& vm, JSBoundFunction* format)
+{
+    m_boundFormat.set(vm, this, format);
+}
+
+EncodedJSValue JSC_HOST_CALL IntlNumberFormatFuncFormatNumber(ExecState* exec)
+{
+    // 11.3.4 Format Number Functions (ECMA-402 2.0)
+    // 1. Let nf be the this value.
+    IntlNumberFormat* format = jsDynamicCast<IntlNumberFormat*>(exec->thisValue());
+    // 2. Assert: Type(nf) is Object and nf has an [[initializedNumberFormat]] internal slot whose value is true.
+    if (!format)
+        return JSValue::encode(throwTypeError(exec));
+
+    // 3. If value is not provided, let value be undefined.
+    // 4. Let x be ToNumber(value).
+    double value = exec->argument(0).toNumber(exec);
+    // 5. ReturnIfAbrupt(x).
+    if (exec->hadException())
+        return JSValue::encode(jsUndefined());
+
+    // 6. Return FormatNumber(nf, x).
+    
+    // 11.3.4 FormatNumber abstract operation (ECMA-402 2.0)
+    // FIXME: Implement FormatNumber.
+
+    return JSValue::encode(jsNumber(value).toString(exec));
+}
+
+} // namespace JSC
+
+#endif // ENABLE(INTL)
diff --git a/Source/JavaScriptCore/runtime/IntlNumberFormat.h b/Source/JavaScriptCore/runtime/IntlNumberFormat.h
new file mode 100644 (file)
index 0000000..cc2538f
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2015 Andy VanWagoner (thetalecrafter@gmail.com)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef IntlNumberFormat_h
+#define IntlNumberFormat_h
+
+#if ENABLE(INTL)
+
+#include "JSDestructibleObject.h"
+
+namespace JSC {
+
+class IntlNumberFormatConstructor;
+class JSBoundFunction;
+
+class IntlNumberFormat : public JSDestructibleObject {
+public:
+    typedef JSDestructibleObject Base;
+
+    static IntlNumberFormat* create(VM&, IntlNumberFormatConstructor*);
+    static Structure* createStructure(VM&, JSGlobalObject*, JSValue);
+
+    DECLARE_INFO;
+
+    JSBoundFunction* boundFormat() const { return m_boundFormat.get(); }
+    void setBoundFormat(VM&, JSBoundFunction*);
+
+protected:
+    IntlNumberFormat(VM&, Structure*);
+    void finishCreation(VM&);
+    static void destroy(JSCell*);
+    static void visitChildren(JSCell*, SlotVisitor&);
+
+    WriteBarrier<JSBoundFunction> m_boundFormat;
+};
+    
+EncodedJSValue JSC_HOST_CALL IntlNumberFormatFuncFormatNumber(ExecState*);
+
+} // namespace JSC
+
+#endif // ENABLE(INTL)
+
+#endif // IntlNumberFormat_h
diff --git a/Source/JavaScriptCore/runtime/IntlNumberFormatConstructor.cpp b/Source/JavaScriptCore/runtime/IntlNumberFormatConstructor.cpp
new file mode 100644 (file)
index 0000000..b8639d6
--- /dev/null
@@ -0,0 +1,183 @@
+/*
+ * Copyright (C) 2015 Andy VanWagoner (thetalecrafter@gmail.com)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+#include "config.h"
+#include "IntlNumberFormatConstructor.h"
+
+#if ENABLE(INTL)
+
+#include "Error.h"
+#include "IntlNumberFormat.h"
+#include "IntlNumberFormatPrototype.h"
+#include "IntlObject.h"
+#include "JSCJSValueInlines.h"
+#include "JSCellInlines.h"
+#include "Lookup.h"
+#include "SlotVisitorInlines.h"
+#include "StructureInlines.h"
+
+namespace JSC {
+
+STATIC_ASSERT_IS_TRIVIALLY_DESTRUCTIBLE(IntlNumberFormatConstructor);
+
+static EncodedJSValue JSC_HOST_CALL IntlNumberFormatConstructorFuncSupportedLocalesOf(ExecState*);
+
+}
+
+#include "IntlNumberFormatConstructor.lut.h"
+
+namespace JSC {
+
+const ClassInfo IntlNumberFormatConstructor::s_info = { "Function", &Base::s_info, &numberFormatConstructorTable, CREATE_METHOD_TABLE(IntlNumberFormatConstructor) };
+
+/* Source for IntlNumberFormatConstructor.lut.h
+@begin numberFormatConstructorTable
+  supportedLocalesOf             IntlNumberFormatConstructorFuncSupportedLocalesOf             DontEnum|Function 1
+@end
+*/
+
+IntlNumberFormatConstructor* IntlNumberFormatConstructor::create(VM& vm, Structure* structure, IntlNumberFormatPrototype* numberFormatPrototype, Structure* numberFormatStructure)
+{
+    IntlNumberFormatConstructor* constructor = new (NotNull, allocateCell<IntlNumberFormatConstructor>(vm.heap)) IntlNumberFormatConstructor(vm, structure);
+    constructor->finishCreation(vm, numberFormatPrototype, numberFormatStructure);
+    return constructor;
+}
+
+Structure* IntlNumberFormatConstructor::createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype)
+{
+    return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info());
+}
+
+IntlNumberFormatConstructor::IntlNumberFormatConstructor(VM& vm, Structure* structure)
+    : InternalFunction(vm, structure)
+{
+}
+
+void IntlNumberFormatConstructor::finishCreation(VM& vm, IntlNumberFormatPrototype* numberFormatPrototype, Structure* numberFormatStructure)
+{
+    Base::finishCreation(vm, ASCIILiteral("NumberFormat"));
+    putDirectWithoutTransition(vm, vm.propertyNames->prototype, numberFormatPrototype, DontEnum | DontDelete | ReadOnly);
+    putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(0), ReadOnly | DontEnum | DontDelete);
+    m_numberFormatStructure.set(vm, this, numberFormatStructure);
+}
+
+EncodedJSValue JSC_HOST_CALL constructIntlNumberFormat(ExecState* exec)
+{
+    // 11.1.2 Intl.NumberFormat ([locales [, options]]) (ECMA-402 2.0)
+    // 1. If NewTarget is undefined, let newTarget be the active function object, else let newTarget be NewTarget.
+    JSValue newTarget = exec->newTarget();
+    if (!newTarget || newTarget.isUndefined())
+        newTarget = exec->callee();
+
+    // 2. Let numberFormat be OrdinaryCreateFromConstructor(newTarget, %NumberFormatPrototype%).
+    VM& vm = exec->vm();
+    IntlNumberFormat* numberFormat = IntlNumberFormat::create(vm, jsCast<IntlNumberFormatConstructor*>(exec->callee()));
+    if (numberFormat && !jsDynamicCast<IntlNumberFormatConstructor*>(newTarget)) {
+        JSValue proto = asObject(newTarget)->getDirect(vm, vm.propertyNames->prototype);
+        asObject(numberFormat)->setPrototypeWithCycleCheck(exec, proto);
+    }
+
+    // 3. ReturnIfAbrupt(numberFormat).
+    ASSERT(numberFormat);
+
+    // 4. Return InitializeNumberFormat(numberFormat, locales, options).
+    // FIXME: return JSValue::encode(InitializeNumberFormat(numberFormat, locales, options));
+
+    return JSValue::encode(numberFormat);
+}
+
+EncodedJSValue JSC_HOST_CALL callIntlNumberFormat(ExecState* exec)
+{
+    // 11.1.2 Intl.NumberFormat ([locales [, options]]) (ECMA-402 2.0)
+    // 1. If NewTarget is undefined, let newTarget be the active function object, else let newTarget be NewTarget.
+    // NewTarget is always undefined when called as a function.
+
+    // 2. Let numberFormat be OrdinaryCreateFromConstructor(newTarget, %NumberFormatPrototype%).
+    VM& vm = exec->vm();
+    IntlNumberFormat* numberFormat = IntlNumberFormat::create(vm, jsCast<IntlNumberFormatConstructor*>(exec->callee()));
+
+    // 3. ReturnIfAbrupt(numberFormat).
+    ASSERT(numberFormat);
+
+    // 4. Return InitializeNumberFormat(numberFormat, locales, options).
+    // FIXME: return JSValue::encode(InitializeNumberFormat(numberFormat, locales, options));
+
+    return JSValue::encode(numberFormat);
+}
+
+ConstructType IntlNumberFormatConstructor::getConstructData(JSCell*, ConstructData& constructData)
+{
+    constructData.native.function = constructIntlNumberFormat;
+    return ConstructTypeHost;
+}
+
+CallType IntlNumberFormatConstructor::getCallData(JSCell*, CallData& callData)
+{
+    callData.native.function = callIntlNumberFormat;
+    return CallTypeHost;
+}
+
+bool IntlNumberFormatConstructor::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
+{
+    return getStaticFunctionSlot<InternalFunction>(exec, numberFormatConstructorTable, jsCast<IntlNumberFormatConstructor*>(object), propertyName, slot);
+}
+
+EncodedJSValue JSC_HOST_CALL IntlNumberFormatConstructorFuncSupportedLocalesOf(ExecState* exec)
+{
+    // 11.2.2 Intl.NumberFormat.supportedLocalesOf(locales [, options]) (ECMA-402 2.0)
+
+    // 1. Let availableLocales be %NumberFormat%.[[availableLocales]].
+    // FIXME: available = IntlNumberFormatConstructor::getAvailableLocales()
+
+    // 2. Let requestedLocales be CanonicalizeLocaleList(locales).
+    // FIXME: requested = CanonicalizeLocaleList(locales)
+
+    // 3. Return SupportedLocales(availableLocales, requestedLocales, options).
+    // FIXME: return JSValue::encode(SupportedLocales(available, requested, options));
+
+    // Return empty array until properly implemented.
+    VM& vm = exec->vm();
+    JSGlobalObject* globalObject = exec->callee()->globalObject();
+    JSArray* supportedLocales = JSArray::tryCreateUninitialized(vm, globalObject->arrayStructureForIndexingTypeDuringAllocation(ArrayWithUndecided), 0);
+    if (!supportedLocales)
+        return JSValue::encode(throwOutOfMemoryError(exec));
+
+    return JSValue::encode(supportedLocales);
+}
+
+void IntlNumberFormatConstructor::visitChildren(JSCell* cell, SlotVisitor& visitor)
+{
+    IntlNumberFormatConstructor* thisObject = jsCast<IntlNumberFormatConstructor*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+
+    Base::visitChildren(thisObject, visitor);
+
+    visitor.append(&thisObject->m_numberFormatStructure);
+}
+
+} // namespace JSC
+
+#endif // ENABLE(INTL)
diff --git a/Source/JavaScriptCore/runtime/IntlNumberFormatConstructor.h b/Source/JavaScriptCore/runtime/IntlNumberFormatConstructor.h
new file mode 100644 (file)
index 0000000..bb75f10
--- /dev/null
@@ -0,0 +1,70 @@
+/*
+ * Copyright (C) 2015 Andy VanWagoner (thetalecrafter@gmail.com)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef IntlNumberFormatConstructor_h
+#define IntlNumberFormatConstructor_h
+
+#if ENABLE(INTL)
+
+#include "InternalFunction.h"
+
+namespace JSC {
+
+class IntlNumberFormat;
+class IntlNumberFormatPrototype;
+
+class IntlNumberFormatConstructor : public InternalFunction {
+public:
+    typedef InternalFunction Base;
+    static const unsigned StructureFlags = Base::StructureFlags | OverridesGetOwnPropertySlot;
+
+    static IntlNumberFormatConstructor* create(VM&, Structure*, IntlNumberFormatPrototype*, Structure*);
+    static Structure* createStructure(VM&, JSGlobalObject*, JSValue);
+
+    DECLARE_INFO;
+
+    Structure* numberFormatStructure() const { return m_numberFormatStructure.get(); }
+
+protected:
+    void finishCreation(VM&, IntlNumberFormatPrototype*, Structure*);
+
+private:
+    IntlNumberFormatConstructor(VM&, Structure*);
+    static ConstructType getConstructData(JSCell*, ConstructData&);
+    static CallType getCallData(JSCell*, CallData&);
+    static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&);
+    static void visitChildren(JSCell*, SlotVisitor&);
+    
+    WriteBarrier<Structure> m_numberFormatStructure;
+};
+
+EncodedJSValue JSC_HOST_CALL constructIntlNumberFormat(ExecState*);
+EncodedJSValue JSC_HOST_CALL callIntlNumberFormat(ExecState*);
+
+} // namespace JSC
+
+#endif // ENABLE(INTL)
+
+#endif // IntlNumberFormatConstructor_h
diff --git a/Source/JavaScriptCore/runtime/IntlNumberFormatPrototype.cpp b/Source/JavaScriptCore/runtime/IntlNumberFormatPrototype.cpp
new file mode 100644 (file)
index 0000000..8a34922
--- /dev/null
@@ -0,0 +1,136 @@
+/*
+ * Copyright (C) 2015 Andy VanWagoner (thetalecrafter@gmail.com)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "IntlNumberFormatPrototype.h"
+
+#if ENABLE(INTL)
+
+#include "Error.h"
+#include "IntlNumberFormat.h"
+#include "JSBoundFunction.h"
+#include "JSCJSValueInlines.h"
+#include "JSCellInlines.h"
+#include "JSObject.h"
+#include "ObjectConstructor.h"
+#include "StructureInlines.h"
+
+namespace JSC {
+
+STATIC_ASSERT_IS_TRIVIALLY_DESTRUCTIBLE(IntlNumberFormatPrototype);
+
+static EncodedJSValue JSC_HOST_CALL IntlNumberFormatPrototypeGetterFormat(ExecState*);
+static EncodedJSValue JSC_HOST_CALL IntlNumberFormatPrototypeFuncResolvedOptions(ExecState*);
+
+}
+
+#include "IntlNumberFormatPrototype.lut.h"
+
+namespace JSC {
+
+const ClassInfo IntlNumberFormatPrototype::s_info = { "Object", &IntlNumberFormat::s_info, &numberFormatPrototypeTable, CREATE_METHOD_TABLE(IntlNumberFormatPrototype) };
+
+/* Source for IntlNumberFormatPrototype.lut.h
+@begin numberFormatPrototypeTable
+  format           IntlNumberFormatPrototypeGetterFormat         DontEnum|Accessor
+  resolvedOptions  IntlNumberFormatPrototypeFuncResolvedOptions  DontEnum|Function 0
+@end
+*/
+
+IntlNumberFormatPrototype* IntlNumberFormatPrototype::create(VM& vm, JSGlobalObject*, Structure* structure)
+{
+    IntlNumberFormatPrototype* object = new (NotNull, allocateCell<IntlNumberFormatPrototype>(vm.heap)) IntlNumberFormatPrototype(vm, structure);
+    object->finishCreation(vm, structure);
+    return object;
+}
+
+Structure* IntlNumberFormatPrototype::createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype)
+{
+    return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info());
+}
+
+IntlNumberFormatPrototype::IntlNumberFormatPrototype(VM& vm, Structure* structure)
+    : IntlNumberFormat(vm, structure)
+{
+}
+
+void IntlNumberFormatPrototype::finishCreation(VM& vm, Structure*)
+{
+    Base::finishCreation(vm);
+}
+
+bool IntlNumberFormatPrototype::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
+{
+    return getStaticFunctionSlot<JSObject>(exec, numberFormatPrototypeTable, jsCast<IntlNumberFormatPrototype*>(object), propertyName, slot);
+}
+
+EncodedJSValue JSC_HOST_CALL IntlNumberFormatPrototypeGetterFormat(ExecState* exec)
+{
+    // 11.3.3 Intl.NumberFormat.prototype.format (ECMA-402 2.0)
+    // 1. Let nf be this NumberFormat object.
+    IntlNumberFormat* nf = jsDynamicCast<IntlNumberFormat*>(exec->thisValue());
+    if (!nf)
+        return JSValue::encode(throwTypeError(exec, ASCIILiteral("Intl.NumberFormat.prototype.format called on value that's not an object initialized as a NumberFormat")));
+    
+    JSBoundFunction* boundFormat = nf->boundFormat();
+    // 2. If nf.[[boundFormat]] is undefined,
+    if (!boundFormat) {
+        VM& vm = exec->vm();
+        JSGlobalObject* globalObject = nf->globalObject();
+        // a. Let F be a new built-in function object as defined in 11.3.4.
+        // b. The value of F’s length property is 1.
+        JSFunction* targetObject = JSFunction::create(vm, globalObject, 1, ASCIILiteral("format"), IntlNumberFormatFuncFormatNumber, NoIntrinsic);
+        JSArray* boundArgs = JSArray::tryCreateUninitialized(vm, globalObject->arrayStructureForIndexingTypeDuringAllocation(ArrayWithUndecided), 0);
+        if (!boundArgs)
+            return JSValue::encode(throwOutOfMemoryError(exec));
+
+        // c. Let bf be BoundFunctionCreate(F, «this value»).
+        boundFormat = JSBoundFunction::create(vm, globalObject, targetObject, nf, boundArgs, 1, ASCIILiteral("format"));
+        // d. Set nf.[[boundFormat]] to bf.
+        nf->setBoundFormat(vm, boundFormat);
+    }
+    // 3. Return nf.[[boundFormat]].
+    return JSValue::encode(boundFormat);
+}
+
+EncodedJSValue JSC_HOST_CALL IntlNumberFormatPrototypeFuncResolvedOptions(ExecState* exec)
+{
+    // 11.3.5 Intl.NumberFormat.prototype.resolvedOptions() (ECMA-402 2.0)
+    IntlNumberFormat* nf = jsDynamicCast<IntlNumberFormat*>(exec->thisValue());
+    if (!nf)
+        return JSValue::encode(throwTypeError(exec, ASCIILiteral("Intl.NumberFormat.prototype.resolvedOptions called on value that's not an object initialized as a NumberFormat")));
+
+    // The function returns a new object whose properties and attributes are set as if constructed by an object literal assigning to each of the following properties the value of the corresponding internal slot of this NumberFormat object (see 11.4): locale, numberingSystem, style, currency, currencyDisplay, minimumIntegerDigits, minimumFractionDigits, maximumFractionDigits, minimumSignificantDigits, maximumSignificantDigits, and useGrouping. Properties whose corresponding internal slots are not present are not assigned.
+
+    JSObject* options = constructEmptyObject(exec);
+
+    // FIXME: Populate object from internal slots.
+
+    return JSValue::encode(options);
+}
+
+} // namespace JSC
+
+#endif // ENABLE(INTL)
diff --git a/Source/JavaScriptCore/runtime/IntlNumberFormatPrototype.h b/Source/JavaScriptCore/runtime/IntlNumberFormatPrototype.h
new file mode 100644 (file)
index 0000000..78bc051
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2015 Andy VanWagoner (thetalecrafter@gmail.com)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef IntlNumberFormatPrototype_h
+#define IntlNumberFormatPrototype_h
+
+#if ENABLE(INTL)
+
+#include "IntlNumberFormat.h"
+#include "JSObject.h"
+
+namespace JSC {
+
+class IntlNumberFormatPrototype : public IntlNumberFormat {
+public:
+    typedef IntlNumberFormat Base;
+    static const unsigned StructureFlags = Base::StructureFlags | OverridesGetOwnPropertySlot;
+
+    static IntlNumberFormatPrototype* create(VM&, JSGlobalObject*, Structure*);
+    static Structure* createStructure(VM&, JSGlobalObject*, JSValue);
+
+    DECLARE_INFO;
+
+protected:
+    void finishCreation(VM&, Structure*);
+
+private:
+    IntlNumberFormatPrototype(VM&, Structure*);
+    static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&);
+};
+
+} // namespace JSC
+
+#endif // ENABLE(INTL)
+
+#endif // IntlNumberFormatPrototype_h
index 12da938..ba457e7 100644 (file)
 
 #if ENABLE(INTL)
 
+#include "FunctionPrototype.h"
+#include "IntlCollator.h"
+#include "IntlCollatorConstructor.h"
+#include "IntlCollatorPrototype.h"
+#include "IntlDateTimeFormat.h"
+#include "IntlDateTimeFormatConstructor.h"
+#include "IntlDateTimeFormatPrototype.h"
+#include "IntlNumberFormat.h"
+#include "IntlNumberFormatConstructor.h"
+#include "IntlNumberFormatPrototype.h"
 #include "JSCInlines.h"
 #include "Lookup.h"
 #include "ObjectPrototype.h"
@@ -48,17 +58,43 @@ IntlObject::IntlObject(VM& vm, Structure* structure)
 {
 }
 
-IntlObject* IntlObject::create(VM& vm, Structure* structure)
+IntlObject* IntlObject::create(VM& vm, JSGlobalObject* globalObject, Structure* structure)
 {
     IntlObject* object = new (NotNull, allocateCell<IntlObject>(vm.heap)) IntlObject(vm, structure);
-    object->finishCreation(vm);
+    object->finishCreation(vm, globalObject);
     return object;
 }
 
-void IntlObject::finishCreation(VM& vm)
+void IntlObject::finishCreation(VM& vm, JSGlobalObject* globalObject)
 {
     Base::finishCreation(vm);
     ASSERT(inherits(info()));
+
+    // Set up Collator.
+    IntlCollatorPrototype* collatorPrototype = IntlCollatorPrototype::create(vm, globalObject, IntlCollatorPrototype::createStructure(vm, globalObject, globalObject->objectPrototype()));
+    Structure* collatorStructure = IntlCollator::createStructure(vm, globalObject, collatorPrototype);
+    IntlCollatorConstructor* collatorConstructor = IntlCollatorConstructor::create(vm, IntlCollatorConstructor::createStructure(vm, globalObject, globalObject->functionPrototype()), collatorPrototype, collatorStructure);
+
+    collatorPrototype->putDirectWithoutTransition(vm, vm.propertyNames->constructor, collatorConstructor, DontEnum);
+
+    // Set up NumberFormat.
+    IntlNumberFormatPrototype* numberFormatPrototype = IntlNumberFormatPrototype::create(vm, globalObject, IntlNumberFormatPrototype::createStructure(vm, globalObject, globalObject->objectPrototype()));
+    Structure* numberFormatStructure = IntlNumberFormat::createStructure(vm, globalObject, numberFormatPrototype);
+    IntlNumberFormatConstructor* numberFormatConstructor = IntlNumberFormatConstructor::create(vm, IntlNumberFormatConstructor::createStructure(vm, globalObject, globalObject->functionPrototype()), numberFormatPrototype, numberFormatStructure);
+
+    numberFormatPrototype->putDirectWithoutTransition(vm, vm.propertyNames->constructor, numberFormatConstructor, DontEnum);
+
+    // Set up DateTimeFormat.
+    IntlDateTimeFormatPrototype* dateTimeFormatPrototype = IntlDateTimeFormatPrototype::create(vm, globalObject, IntlDateTimeFormatPrototype::createStructure(vm, globalObject, globalObject->objectPrototype()));
+    Structure* dateTimeFormatStructure = IntlDateTimeFormat::createStructure(vm, globalObject, dateTimeFormatPrototype);
+    IntlDateTimeFormatConstructor* dateTimeFormatConstructor = IntlDateTimeFormatConstructor::create(vm, IntlDateTimeFormatConstructor::createStructure(vm, globalObject, globalObject->functionPrototype()), dateTimeFormatPrototype, dateTimeFormatStructure);
+
+    dateTimeFormatPrototype->putDirectWithoutTransition(vm, vm.propertyNames->constructor, dateTimeFormatConstructor, DontEnum);
+
+    // 8.1 Properties of the Intl Object (ECMA-402 2.0)
+    putDirectWithoutTransition(vm, vm.propertyNames->Collator, collatorConstructor, DontEnum);
+    putDirectWithoutTransition(vm, vm.propertyNames->NumberFormat, numberFormatConstructor, DontEnum);
+    putDirectWithoutTransition(vm, vm.propertyNames->DateTimeFormat, dateTimeFormatConstructor, DontEnum);
 }
 
 Structure* IntlObject::createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype)
index f45b9ab..8342854 100644 (file)
 
 namespace JSC {
 
+class IntlCollatorConstructor;
+class IntlCollatorPrototype;
+class IntlDateTimeFormatConstructor;
+class IntlDateTimeFormatPrototype;
+class IntlNumberFormatConstructor;
+class IntlNumberFormatPrototype;
+
 class IntlObject : public JSNonFinalObject {
 public:
     typedef JSNonFinalObject Base;
     static const unsigned StructureFlags = Base::StructureFlags | OverridesGetOwnPropertySlot;
 
-    static IntlObject* create(VM&, Structure*);
+    static IntlObject* create(VM&, JSGlobalObject*, Structure*);
     static Structure* createStructure(VM&, JSGlobalObject*, JSValue);
 
     DECLARE_INFO;
 
 protected:
-    void finishCreation(VM&);
+    void finishCreation(VM&, JSGlobalObject*);
 
 private:
     IntlObject(VM&, Structure*);
index 29f1037..7ae2e9e 100644 (file)
@@ -431,7 +431,7 @@ putDirectWithoutTransition(vm, vm.propertyNames-> jsName, lowerName ## Construct
     putDirectWithoutTransition(vm, vm.propertyNames->eval, m_evalFunction.get(), DontEnum);
     
 #if ENABLE(INTL)
-    putDirectWithoutTransition(vm, vm.propertyNames->Intl, IntlObject::create(vm, IntlObject::createStructure(vm, this, m_objectPrototype.get())), DontEnum);
+    putDirectWithoutTransition(vm, vm.propertyNames->Intl, IntlObject::create(vm, this, IntlObject::createStructure(vm, this, m_objectPrototype.get())), DontEnum);
 #endif // ENABLE(INTL)
     putDirectWithoutTransition(vm, vm.propertyNames->JSON, JSONObject::create(vm, JSONObject::createStructure(vm, this, m_objectPrototype.get())), DontEnum);
     putDirectWithoutTransition(vm, vm.propertyNames->Math, MathObject::create(vm, this, MathObject::createStructure(vm, this, m_objectPrototype.get())), DontEnum);
index ea49743..37c2e8d 100644 (file)
@@ -1,3 +1,12 @@
+2015-07-29  Andy VanWagoner  <thetalecrafter@gmail.com>
+
+        Implement basic types for ECMAScript Internationalization API
+        https://bugs.webkit.org/show_bug.cgi?id=146926
+
+        Reviewed by Benjamin Poulain.
+
+        * Configurations/FeatureDefines.xcconfig: Enabled INTL.
+
 2015-07-29  Chris Dumez  <cdumez@apple.com>
 
         Make TextLayout fast allocated
index e160c7f..bce860a 100644 (file)
@@ -117,7 +117,7 @@ ENABLE_WIRELESS_PLAYBACK_TARGET_macosx_101000 = ;
 ENABLE_WIRELESS_PLAYBACK_TARGET_macosx_101100 = ENABLE_WIRELESS_PLAYBACK_TARGET;
 ENABLE_WIRELESS_PLAYBACK_TARGET_macosx_101200 = ENABLE_WIRELESS_PLAYBACK_TARGET;
 
-ENABLE_INTL = ;
+ENABLE_INTL = ENABLE_INTL;
 
 ENABLE_IOS_GESTURE_EVENTS[sdk=iphone*] = $(ENABLE_IOS_GESTURE_EVENTS_ios_WITH_INTERNAL_SDK_$(USE_INTERNAL_SDK));
 ENABLE_IOS_GESTURE_EVENTS_ios_WITH_INTERNAL_SDK_YES = ENABLE_IOS_GESTURE_EVENTS;
index f65a6e2..8d25bdf 100644 (file)
@@ -1,3 +1,12 @@
+2015-07-29  Andy VanWagoner  <thetalecrafter@gmail.com>
+
+        Implement basic types for ECMAScript Internationalization API
+        https://bugs.webkit.org/show_bug.cgi?id=146926
+
+        Reviewed by Benjamin Poulain.
+
+        * Configurations/FeatureDefines.xcconfig: Enabled INTL.
+
 2015-07-28  Yusuke Suzuki  <utatane.tea@gmail.com>
 
         [ES6] Add ENABLE_ES6_MODULES compile time flag with the default value "false"
index e160c7f..bce860a 100644 (file)
@@ -117,7 +117,7 @@ ENABLE_WIRELESS_PLAYBACK_TARGET_macosx_101000 = ;
 ENABLE_WIRELESS_PLAYBACK_TARGET_macosx_101100 = ENABLE_WIRELESS_PLAYBACK_TARGET;
 ENABLE_WIRELESS_PLAYBACK_TARGET_macosx_101200 = ENABLE_WIRELESS_PLAYBACK_TARGET;
 
-ENABLE_INTL = ;
+ENABLE_INTL = ENABLE_INTL;
 
 ENABLE_IOS_GESTURE_EVENTS[sdk=iphone*] = $(ENABLE_IOS_GESTURE_EVENTS_ios_WITH_INTERNAL_SDK_$(USE_INTERNAL_SDK));
 ENABLE_IOS_GESTURE_EVENTS_ios_WITH_INTERNAL_SDK_YES = ENABLE_IOS_GESTURE_EVENTS;
index c7c6d9b..6ffa72f 100644 (file)
@@ -1,3 +1,12 @@
+2015-07-29  Andy VanWagoner  <thetalecrafter@gmail.com>
+
+        Implement basic types for ECMAScript Internationalization API
+        https://bugs.webkit.org/show_bug.cgi?id=146926
+
+        Reviewed by Benjamin Poulain.
+
+        * Configurations/FeatureDefines.xcconfig: Enabled INTL.
+
 2015-07-29  Chris Dumez  <cdumez@apple.com>
 
         [WK2] Use FastMalloc in IPC::MessageDecoder
index e160c7f..bce860a 100644 (file)
@@ -117,7 +117,7 @@ ENABLE_WIRELESS_PLAYBACK_TARGET_macosx_101000 = ;
 ENABLE_WIRELESS_PLAYBACK_TARGET_macosx_101100 = ENABLE_WIRELESS_PLAYBACK_TARGET;
 ENABLE_WIRELESS_PLAYBACK_TARGET_macosx_101200 = ENABLE_WIRELESS_PLAYBACK_TARGET;
 
-ENABLE_INTL = ;
+ENABLE_INTL = ENABLE_INTL;
 
 ENABLE_IOS_GESTURE_EVENTS[sdk=iphone*] = $(ENABLE_IOS_GESTURE_EVENTS_ios_WITH_INTERNAL_SDK_$(USE_INTERNAL_SDK));
 ENABLE_IOS_GESTURE_EVENTS_ios_WITH_INTERNAL_SDK_YES = ENABLE_IOS_GESTURE_EVENTS;
index 300c738..f20df6b 100644 (file)
@@ -98,7 +98,7 @@ macro(WEBKIT_OPTION_BEGIN)
     WEBKIT_OPTION_DEFINE(ENABLE_INPUT_TYPE_MONTH "Toggle month type <input> support" PRIVATE OFF)
     WEBKIT_OPTION_DEFINE(ENABLE_INPUT_TYPE_TIME "Toggle time type <input> support" PRIVATE OFF)
     WEBKIT_OPTION_DEFINE(ENABLE_INPUT_TYPE_WEEK "Toggle week type <input> support" PRIVATE OFF)
-    WEBKIT_OPTION_DEFINE(ENABLE_INTL "Toggle Intl support" PRIVATE OFF)
+    WEBKIT_OPTION_DEFINE(ENABLE_INTL "Toggle Intl support" PRIVATE ON)
     WEBKIT_OPTION_DEFINE(ENABLE_IOS_AIRPLAY "Toggle iOS airplay support" PRIVATE OFF)
     WEBKIT_OPTION_DEFINE(ENABLE_IOS_TEXT_AUTOSIZING "Toggle iOS text autosizing support" PRIVATE OFF)
     WEBKIT_OPTION_DEFINE(ENABLE_JIT "Enable JustInTime javascript support" PRIVATE ON)
index 80fb7e7..2de065e 100644 (file)
@@ -1,3 +1,14 @@
+2015-07-29  Andy VanWagoner  <thetalecrafter@gmail.com>
+
+        Implement basic types for ECMAScript Internationalization API
+        https://bugs.webkit.org/show_bug.cgi?id=146926
+
+        Reviewed by Benjamin Poulain.
+
+        Enable flag now that the basic objects are in place.
+
+        * Scripts/webkitperl/FeatureList.pm: Enabled INTL
+
 2015-07-28  Carlos Garcia Campos  <cgarcia@igalia.com>
 
         [GTK] Add API to set the maximum number of web processes per WebKitWebContext
index b3f65a5..2bd6145 100644 (file)
@@ -291,7 +291,7 @@ my @features = (
       define => "ENABLE_INPUT_TYPE_WEEK", default => 0, value => \$inputTypeWeekSupport },
 
     { option => "intl", desc => "Toggle Intl support",
-      define => "ENABLE_INTL", default => 0, value => \$intlSupport },
+      define => "ENABLE_INTL", default => 1, value => \$intlSupport },
 
     { option => "legacy-notifications", desc => "Toggle Legacy Notifications support",
       define => "ENABLE_LEGACY_NOTIFICATIONS", default => 0, value => \$legacyNotificationsSupport },