[INTL] Improve spec & test262 compliance for Intl APIs
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 13 May 2018 14:28:39 +0000 (14:28 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 13 May 2018 14:28:39 +0000 (14:28 +0000)
commit9ad91dac51229c544e3bea5fc3dae2cb7211101e
tree6acb8077fa8d23391463cd05020a18b8288aa426
parent9b05484f0a0bff403ed2d8cc3fff4bc345cd1b15
[INTL] Improve spec & test262 compliance for Intl APIs
https://bugs.webkit.org/show_bug.cgi?id=185578

Patch by Andy VanWagoner <andy@vanwagoner.family> on 2018-05-13
Reviewed by Yusuke Suzuki.

JSTests:

Remove intl402 failures that have been fixed.

* test262/expectations.yaml:
* stress/regress-178385.js: toStringTag is configurable, but not writable.

Source/JavaScriptCore:

Use putDirectIndex over push for lists to arrays.
Update default options to construct with a null prototype.
Define constructor and toStringTag on prototypes.
Add proper time clipping.
Remove some outdated comment spec text, use url instead.

* runtime/IntlCollator.cpp:
(JSC::IntlCollator::initializeCollator):
* runtime/IntlCollatorConstructor.cpp:
(JSC::IntlCollatorConstructor::finishCreation):
* runtime/IntlCollatorPrototype.cpp:
(JSC::IntlCollatorPrototype::finishCreation):
* runtime/IntlDateTimeFormatConstructor.cpp:
(JSC::IntlDateTimeFormatConstructor::finishCreation):
* runtime/IntlDateTimeFormatPrototype.cpp:
(JSC::IntlDateTimeFormatPrototype::finishCreation):
(JSC::IntlDateTimeFormatFuncFormatDateTime):
(JSC::IntlDateTimeFormatPrototypeFuncFormatToParts):
* runtime/IntlNumberFormat.cpp:
(JSC::IntlNumberFormat::initializeNumberFormat):
* runtime/IntlNumberFormatConstructor.cpp:
(JSC::IntlNumberFormatConstructor::finishCreation):
* runtime/IntlNumberFormatPrototype.cpp:
(JSC::IntlNumberFormatPrototype::finishCreation):
* runtime/IntlObject.cpp:
(JSC::lookupSupportedLocales):
(JSC::supportedLocales):
(JSC::intlObjectFuncGetCanonicalLocales):
* runtime/IntlPluralRules.cpp:
(JSC::IntlPluralRules::resolvedOptions):
* runtime/IntlPluralRulesConstructor.cpp:
(JSC::IntlPluralRulesConstructor::finishCreation):

LayoutTests:

Update Intl tests for prototype changes.

* js/intl-collator-expected.txt:
* js/intl-datetimeformat-expected.txt:
* js/intl-numberformat-expected.txt:
* js/script-tests/intl-collator.js:
* js/script-tests/intl-datetimeformat.js:
* js/script-tests/intl-numberformat.js:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231740 268f45cc-cd09-0410-ab3c-d52691b4dbfc
22 files changed:
JSTests/ChangeLog
JSTests/stress/regress-178385.js
JSTests/test262/expectations.yaml
LayoutTests/ChangeLog
LayoutTests/js/intl-collator-expected.txt
LayoutTests/js/intl-datetimeformat-expected.txt
LayoutTests/js/intl-numberformat-expected.txt
LayoutTests/js/script-tests/intl-collator.js
LayoutTests/js/script-tests/intl-datetimeformat.js
LayoutTests/js/script-tests/intl-numberformat.js
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/runtime/IntlCollator.cpp
Source/JavaScriptCore/runtime/IntlCollatorConstructor.cpp
Source/JavaScriptCore/runtime/IntlCollatorPrototype.cpp
Source/JavaScriptCore/runtime/IntlDateTimeFormatConstructor.cpp
Source/JavaScriptCore/runtime/IntlDateTimeFormatPrototype.cpp
Source/JavaScriptCore/runtime/IntlNumberFormat.cpp
Source/JavaScriptCore/runtime/IntlNumberFormatConstructor.cpp
Source/JavaScriptCore/runtime/IntlNumberFormatPrototype.cpp
Source/JavaScriptCore/runtime/IntlObject.cpp
Source/JavaScriptCore/runtime/IntlPluralRules.cpp
Source/JavaScriptCore/runtime/IntlPluralRulesConstructor.cpp