Title: [231196] trunk
Revision
231196
Author
[email protected]
Date
2018-05-01 08:47:29 -0700 (Tue, 01 May 2018)

Log Message

IntlObject.cpp::removeUnicodeLocaleExtension() should not touch locales that end in '-u'
https://bugs.webkit.org/show_bug.cgi?id=185162

Reviewed by Filip Pizlo.

JSTests:

* stress/incomplete-unicode-locale.js: Added.
(catch):

Source/_javascript_Core:

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

Modified Paths

Added Paths

Diff

Modified: trunk/JSTests/ChangeLog (231195 => 231196)


--- trunk/JSTests/ChangeLog	2018-05-01 15:42:11 UTC (rev 231195)
+++ trunk/JSTests/ChangeLog	2018-05-01 15:47:29 UTC (rev 231196)
@@ -1,3 +1,13 @@
+2018-05-01  Robin Morisset  <[email protected]>
+
+        IntlObject.cpp::removeUnicodeLocaleExtension() should not touch locales that end in '-u'
+        https://bugs.webkit.org/show_bug.cgi?id=185162
+
+        Reviewed by Filip Pizlo.
+
+        * stress/incomplete-unicode-locale.js: Added.
+        (catch):
+
 2018-05-01  Dominik Infuehr  <[email protected]>
 
         Add SetCallee as DFG-Operation

Added: trunk/JSTests/stress/incomplete-unicode-locale.js (0 => 231196)


--- trunk/JSTests/stress/incomplete-unicode-locale.js	                        (rev 0)
+++ trunk/JSTests/stress/incomplete-unicode-locale.js	2018-05-01 15:47:29 UTC (rev 231196)
@@ -0,0 +1,3 @@
+try {
+    new Intl.NumberFormat("en-x-u");
+} catch (e) {}

Modified: trunk/Source/_javascript_Core/ChangeLog (231195 => 231196)


--- trunk/Source/_javascript_Core/ChangeLog	2018-05-01 15:42:11 UTC (rev 231195)
+++ trunk/Source/_javascript_Core/ChangeLog	2018-05-01 15:47:29 UTC (rev 231196)
@@ -1,3 +1,13 @@
+2018-05-01  Robin Morisset  <[email protected]>
+
+        IntlObject.cpp::removeUnicodeLocaleExtension() should not touch locales that end in '-u'
+        https://bugs.webkit.org/show_bug.cgi?id=185162
+
+        Reviewed by Filip Pizlo.
+
+        * runtime/IntlObject.cpp:
+        (JSC::removeUnicodeLocaleExtension):
+
 2018-05-01  Dominik Infuehr  <[email protected]>
 
         Add SetCallee as DFG-Operation

Modified: trunk/Source/_javascript_Core/runtime/IntlObject.cpp (231195 => 231196)


--- trunk/Source/_javascript_Core/runtime/IntlObject.cpp	2018-05-01 15:42:11 UTC (rev 231195)
+++ trunk/Source/_javascript_Core/runtime/IntlObject.cpp	2018-05-01 15:47:29 UTC (rev 231196)
@@ -614,7 +614,7 @@
     if (partsSize > 0)
         builder.append(parts[0]);
     for (size_t p = 1; p < partsSize; ++p) {
-        if (parts[p] == "u") {
+        if (parts[p] == "u" && p + 1 < partsSize) {
             // Skip the u- and anything that follows until another singleton.
             // While the next part is part of the unicode extension, skip it.
             while (p + 1 < partsSize && parts[p + 1].length() > 1)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to