WebKit Bugzilla
Attachment 346078 Details for
Bug 188176
: [INTL] Allow "unknown" formatToParts types
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-188176-20180730123219.patch (text/plain), 4.18 KB, created by
Andy VanWagoner
on 2018-07-30 11:32:19 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Andy VanWagoner
Created:
2018-07-30 11:32:19 PDT
Size:
4.18 KB
patch
obsolete
>Subversion Revision: 234368 >diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog >index c9ffa59ac12c5b4b5cc33a7f72b7b0e52bf7a4af..3c709ef5a774c9b122757256475905eccee88318 100644 >--- a/Source/JavaScriptCore/ChangeLog >+++ b/Source/JavaScriptCore/ChangeLog >@@ -1,3 +1,24 @@ >+2018-07-30 Andy VanWagoner <andy@vanwagoner.family> >+ >+ [INTL] Allow "unknown" formatToParts types >+ https://bugs.webkit.org/show_bug.cgi?id=188176 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ 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): >+ > 2018-07-30 Mark Lam <mark.lam@apple.com> > > Add a debugging utility to dump the memory layout of a JSCell. >diff --git a/Source/JavaScriptCore/runtime/IntlDateTimeFormat.cpp b/Source/JavaScriptCore/runtime/IntlDateTimeFormat.cpp >index f340301a9d273ac902aabbb2d6ad14ca96718e5f..fae63fbd07ae41a64b65190fbf675260d553d5ae 100644 >--- a/Source/JavaScriptCore/runtime/IntlDateTimeFormat.cpp >+++ b/Source/JavaScriptCore/runtime/IntlDateTimeFormat.cpp >@@ -959,7 +959,7 @@ ASCIILiteral IntlDateTimeFormat::partTypeString(UDateFormatField field) > case UDAT_TIMEZONE_ISO_LOCAL_FIELD: > return "timeZoneName"_s; > // These should not show up because there is no way to specify them in DateTimeFormat options. >- // If they do, they don't fit well into any of known part types, so consider it a "literal". >+ // If they do, they don't fit well into any of known part types, so consider it an "unknown". > case UDAT_DAY_OF_YEAR_FIELD: > case UDAT_DAY_OF_WEEK_IN_MONTH_FIELD: > case UDAT_WEEK_OF_YEAR_FIELD: >@@ -974,10 +974,10 @@ ASCIILiteral IntlDateTimeFormat::partTypeString(UDateFormatField field) > #if U_ICU_VERSION_MAJOR_NUM < 58 || !defined(U_HIDE_DEPRECATED_API) > case UDAT_FIELD_COUNT: > #endif >- return "literal"_s; >+ return "unknown"_s; > } >- // Any newer additions to the UDateFormatField enum should just be considered a "literal" part. >- return "literal"_s; >+ // Any newer additions to the UDateFormatField enum should just be considered an "unknown" part. >+ return "unknown"_s; > } > > >diff --git a/Source/JavaScriptCore/runtime/IntlNumberFormat.cpp b/Source/JavaScriptCore/runtime/IntlNumberFormat.cpp >index 218c4d6d6be4b81c80e6451517dacca6203f62f8..4d41845d9d2f5f93c90357e6cac82ca4090b2c76 100644 >--- a/Source/JavaScriptCore/runtime/IntlNumberFormat.cpp >+++ b/Source/JavaScriptCore/runtime/IntlNumberFormat.cpp >@@ -468,7 +468,7 @@ ASCIILiteral IntlNumberFormat::partTypeString(UNumberFormatFields field, double > case UNUM_SIGN_FIELD: > return value < 0 ? "minusSign"_s : "plusSign"_s; > // These should not show up because there is no way to specify them in NumberFormat options. >- // If they do, they don't fit well into any of known part types, so consider it a "literal". >+ // If they do, they don't fit well into any of known part types, so consider it an "unknown". > case UNUM_PERMILL_FIELD: > case UNUM_EXPONENT_SYMBOL_FIELD: > case UNUM_EXPONENT_SIGN_FIELD: >@@ -476,10 +476,10 @@ ASCIILiteral IntlNumberFormat::partTypeString(UNumberFormatFields field, double > #if !defined(U_HIDE_DEPRECATED_API) > case UNUM_FIELD_COUNT: > #endif >- return "literal"_s; >+ return "unknown"_s; > } >- // Any newer additions to the UNumberFormatFields enum should just be considered a "literal" part. >- return "literal"_s; >+ // Any newer additions to the UNumberFormatFields enum should just be considered an "unknown" part. >+ return "unknown"_s; > } > > JSValue IntlNumberFormat::formatToParts(ExecState& exec, double value)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 188176
: 346078 |
346135