Title: [282890] trunk
Revision
282890
Author
ysuz...@apple.com
Date
2021-09-22 16:18:44 -0700 (Wed, 22 Sep 2021)

Log Message

[JSC] Intl unicode identifier type will reject underscore
https://bugs.webkit.org/show_bug.cgi?id=230645

Reviewed by Ross Kirsling.

JSTests:

* test262/expectations.yaml:

Source/_javascript_Core:

We reject '_' since BCP-47 rejects it and we should follow BCP-47 in all Intl inputs.

* runtime/IntlObject.cpp:
(JSC::isUnicodeLocaleIdentifierType):

Modified Paths

Diff

Modified: trunk/JSTests/ChangeLog (282889 => 282890)


--- trunk/JSTests/ChangeLog	2021-09-22 23:18:25 UTC (rev 282889)
+++ trunk/JSTests/ChangeLog	2021-09-22 23:18:44 UTC (rev 282890)
@@ -1,5 +1,14 @@
 2021-09-22  Yusuke Suzuki  <ysuz...@apple.com>
 
+        [JSC] Intl unicode identifier type will reject underscore
+        https://bugs.webkit.org/show_bug.cgi?id=230645
+
+        Reviewed by Ross Kirsling.
+
+        * test262/expectations.yaml:
+
+2021-09-22  Yusuke Suzuki  <ysuz...@apple.com>
+
         [JSC] Upgrade test262
         https://bugs.webkit.org/show_bug.cgi?id=230641
 

Modified: trunk/JSTests/test262/expectations.yaml (282889 => 282890)


--- trunk/JSTests/test262/expectations.yaml	2021-09-22 23:18:25 UTC (rev 282889)
+++ trunk/JSTests/test262/expectations.yaml	2021-09-22 23:18:44 UTC (rev 282890)
@@ -834,9 +834,6 @@
 test/intl402/DateTimeFormat/prototype/resolvedOptions/hourCycle-default.js:
   default: 'Test262Error: Expected SameValue(«h24», «h23») to be true'
   strict mode: 'Test262Error: Expected SameValue(«h24», «h23») to be true'
-test/intl402/DisplayNames/prototype/of/type-calendar-invalid.js:
-  default: 'Test262Error: 2 segments, minimum length, underscore Expected a RangeError to be thrown but no exception was thrown at all'
-  strict mode: 'Test262Error: 2 segments, minimum length, underscore Expected a RangeError to be thrown but no exception was thrown at all'
 test/intl402/Intl/getCanonicalLocales/non-iana-canon.js:
   default: 'Test262Error: The value of Intl.getCanonicalLocales(tag)[0] equals the value of `canonical` Expected SameValue(«en-US-u-va-posix», «posix») to be true'
   strict mode: 'Test262Error: The value of Intl.getCanonicalLocales(tag)[0] equals the value of `canonical` Expected SameValue(«en-US-u-va-posix», «posix») to be true'

Modified: trunk/Source/_javascript_Core/ChangeLog (282889 => 282890)


--- trunk/Source/_javascript_Core/ChangeLog	2021-09-22 23:18:25 UTC (rev 282889)
+++ trunk/Source/_javascript_Core/ChangeLog	2021-09-22 23:18:44 UTC (rev 282890)
@@ -1,3 +1,15 @@
+2021-09-22  Yusuke Suzuki  <ysuz...@apple.com>
+
+        [JSC] Intl unicode identifier type will reject underscore
+        https://bugs.webkit.org/show_bug.cgi?id=230645
+
+        Reviewed by Ross Kirsling.
+
+        We reject '_' since BCP-47 rejects it and we should follow BCP-47 in all Intl inputs.
+
+        * runtime/IntlObject.cpp:
+        (JSC::isUnicodeLocaleIdentifierType):
+
 2021-09-21  Alexey Shvayka  <shvaikal...@gmail.com>
 
         [WebIDL] DOM constructors should extend InternalFunction

Modified: trunk/Source/_javascript_Core/runtime/IntlObject.cpp (282889 => 282890)


--- trunk/Source/_javascript_Core/runtime/IntlObject.cpp	2021-09-22 23:18:25 UTC (rev 282889)
+++ trunk/Source/_javascript_Core/runtime/IntlObject.cpp	2021-09-22 23:18:44 UTC (rev 282890)
@@ -661,10 +661,6 @@
 // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier
 bool isUnicodeLocaleIdentifierType(StringView string)
 {
-    // Matching the Unicode Locale Identifier type nonterminal.
-    // Because the spec abstract operation is not mentioning to BCP-47 conformance for this matching,
-    // '-' and '_' separators are allowed while BCP-47 only accepts '-'.
-    // On the other hand, IsStructurallyValidLanguageTag explicitly mentions to BCP-47.
     return readCharactersForParsing(string, [](auto buffer) -> bool {
         while (true) {
             auto begin = buffer.position();
@@ -675,7 +671,7 @@
                 return false;
             if (!buffer.hasCharactersRemaining())
                 return true;
-            if (*buffer != '-' && *buffer != '_')
+            if (*buffer != '-')
                 return false;
             ++buffer;
         }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to