[INTL] Allow "unknown" formatToParts types
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 1 Aug 2018 21:21:39 +0000 (21:21 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 1 Aug 2018 21:21:39 +0000 (21:21 +0000)
commit93966bffad40e5e72b227f82508770fc91ffe9fd
tree55febfa0bb58b30f6ff33578b8d03e291cf4995b
parentbb02eabf38d548033ac0506a243e2b7fb01efde0
[INTL] Allow "unknown" formatToParts types
https://bugs.webkit.org/show_bug.cgi?id=188176

Patch by Andy VanWagoner <andy@vanwagoner.family> on 2018-08-01
Reviewed by Darin Adler.

Originally extra unexpected field types were marked as "literal", since
the spec did not account for these. The ECMA 402 spec has since been updated
to specify "unknown" should be used in these cases.

Currently there is no known way to reach these cases, so no tests can
account for them. Theoretically they shoudn't exist, but they are specified,
just to be safe. Marking them as "unknown" instead of "literal" hopefully
will make such cases easy to identify if they ever happen.

* runtime/IntlDateTimeFormat.cpp:
(JSC::IntlDateTimeFormat::partTypeString):
* runtime/IntlNumberFormat.cpp:
(JSC::IntlNumberFormat::partTypeString):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234477 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/runtime/IntlDateTimeFormat.cpp
Source/JavaScriptCore/runtime/IntlNumberFormat.cpp