Title: [251815] trunk
Revision
251815
Author
[email protected]
Date
2019-10-30 15:41:52 -0700 (Wed, 30 Oct 2019)

Log Message

Intl.DateTimeFormat returns resolvedOptions in the wrong order
https://bugs.webkit.org/show_bug.cgi?id=203297

Reviewed by Yusuke Suzuki.

JSTests:

* test262/expectations.yaml:
Mark two test cases as passing.

Source/_javascript_Core:

See table here:
https://tc39.es/ecma402/#table-datetimeformat-resolvedoptions-properties

* runtime/IntlDateTimeFormat.cpp:
(JSC::IntlDateTimeFormat::resolvedOptions):

Modified Paths

Diff

Modified: trunk/JSTests/ChangeLog (251814 => 251815)


--- trunk/JSTests/ChangeLog	2019-10-30 22:39:31 UTC (rev 251814)
+++ trunk/JSTests/ChangeLog	2019-10-30 22:41:52 UTC (rev 251815)
@@ -1,3 +1,13 @@
+2019-10-30  Ross Kirsling  <[email protected]>
+
+        Intl.DateTimeFormat returns resolvedOptions in the wrong order
+        https://bugs.webkit.org/show_bug.cgi?id=203297
+
+        Reviewed by Yusuke Suzuki.
+
+        * test262/expectations.yaml:
+        Mark two test cases as passing.
+
 2019-10-30  Tadeu Zagallo  <[email protected]>
 
         tryCachePutToScopeGlobal should hold the lock to update metadata.m_getPutInfo

Modified: trunk/JSTests/test262/expectations.yaml (251814 => 251815)


--- trunk/JSTests/test262/expectations.yaml	2019-10-30 22:39:31 UTC (rev 251814)
+++ trunk/JSTests/test262/expectations.yaml	2019-10-30 22:41:52 UTC (rev 251815)
@@ -1894,14 +1894,11 @@
   default: 'Test262Error: Expected SameValue(«false», «true») to be true'
   strict mode: 'Test262Error: Expected SameValue(«false», «true») to be true'
 test/intl402/DateTimeFormat/prototype/resolvedOptions/order-dayPeriod.js:
-  default: 'Test262Error: Expected [locale, calendar, numberingSystem, timeZone, hour, hourCycle, hour12, minute] and [locale, calendar, numberingSystem, timeZone, hourCycle, hour12, dayPeriod, hour, minute] to have the same contents. '
-  strict mode: 'Test262Error: Expected [locale, calendar, numberingSystem, timeZone, hour, hourCycle, hour12, minute] and [locale, calendar, numberingSystem, timeZone, hourCycle, hour12, dayPeriod, hour, minute] to have the same contents. '
+  default: 'Test262Error: Expected [locale, calendar, numberingSystem, timeZone, hourCycle, hour12, hour, minute] and [locale, calendar, numberingSystem, timeZone, hourCycle, hour12, dayPeriod, hour, minute] to have the same contents. '
+  strict mode: 'Test262Error: Expected [locale, calendar, numberingSystem, timeZone, hourCycle, hour12, hour, minute] and [locale, calendar, numberingSystem, timeZone, hourCycle, hour12, dayPeriod, hour, minute] to have the same contents. '
 test/intl402/DateTimeFormat/prototype/resolvedOptions/order-fractionalSecondDigits.js:
   default: 'Test262Error: Expected [locale, calendar, numberingSystem, timeZone, minute, second] and [locale, calendar, numberingSystem, timeZone, minute, second, fractionalSecondDigits] to have the same contents. '
   strict mode: 'Test262Error: Expected [locale, calendar, numberingSystem, timeZone, minute, second] and [locale, calendar, numberingSystem, timeZone, minute, second, fractionalSecondDigits] to have the same contents. '
-test/intl402/DateTimeFormat/prototype/resolvedOptions/order.js:
-  default: 'Test262Error: Expected [locale, calendar, numberingSystem, timeZone, weekday, era, year, month, day, hour, hourCycle, hour12, minute, second, timeZoneName] and [locale, calendar, numberingSystem, timeZone, hourCycle, hour12, weekday, era, year, month, day, hour, minute, second, timeZoneName] to have the same contents. '
-  strict mode: 'Test262Error: Expected [locale, calendar, numberingSystem, timeZone, weekday, era, year, month, day, hour, hourCycle, hour12, minute, second, timeZoneName] and [locale, calendar, numberingSystem, timeZone, hourCycle, hour12, weekday, era, year, month, day, hour, minute, second, timeZoneName] to have the same contents. '
 test/intl402/Intl/getCanonicalLocales/canonicalized-tags.js:
   default: 'Test262Error: Expected SameValue(«cmn», «zh») to be true'
   strict mode: 'Test262Error: Expected SameValue(«cmn», «zh») to be true'

Modified: trunk/Source/_javascript_Core/ChangeLog (251814 => 251815)


--- trunk/Source/_javascript_Core/ChangeLog	2019-10-30 22:39:31 UTC (rev 251814)
+++ trunk/Source/_javascript_Core/ChangeLog	2019-10-30 22:41:52 UTC (rev 251815)
@@ -1,3 +1,16 @@
+2019-10-30  Ross Kirsling  <[email protected]>
+
+        Intl.DateTimeFormat returns resolvedOptions in the wrong order
+        https://bugs.webkit.org/show_bug.cgi?id=203297
+
+        Reviewed by Yusuke Suzuki.
+
+        See table here:
+        https://tc39.es/ecma402/#table-datetimeformat-resolvedoptions-properties
+
+        * runtime/IntlDateTimeFormat.cpp:
+        (JSC::IntlDateTimeFormat::resolvedOptions):
+
 2019-10-30  Tadeu Zagallo  <[email protected]>
 
         tryCachePutToScopeGlobal should hold the lock to update metadata.m_getPutInfo

Modified: trunk/Source/_javascript_Core/runtime/IntlDateTimeFormat.cpp (251814 => 251815)


--- trunk/Source/_javascript_Core/runtime/IntlDateTimeFormat.cpp	2019-10-30 22:39:31 UTC (rev 251814)
+++ trunk/Source/_javascript_Core/runtime/IntlDateTimeFormat.cpp	2019-10-30 22:41:52 UTC (rev 251815)
@@ -853,6 +853,11 @@
     options->putDirect(vm, vm.propertyNames->numberingSystem, jsNontrivialString(vm, m_numberingSystem));
     options->putDirect(vm, vm.propertyNames->timeZone, jsNontrivialString(vm, m_timeZone));
 
+    if (!m_hourCycle.isNull()) {
+        options->putDirect(vm, vm.propertyNames->hourCycle, jsNontrivialString(vm, m_hourCycle));
+        options->putDirect(vm, vm.propertyNames->hour12, jsBoolean(m_hourCycle == "h11" || m_hourCycle == "h12"));
+    }
+
     if (m_weekday != Weekday::None)
         options->putDirect(vm, vm.propertyNames->weekday, jsNontrivialString(vm, weekdayString(m_weekday)));
 
@@ -871,11 +876,6 @@
     if (m_hour != Hour::None)
         options->putDirect(vm, vm.propertyNames->hour, jsNontrivialString(vm, hourString(m_hour)));
 
-    if (!m_hourCycle.isNull()) {
-        options->putDirect(vm, vm.propertyNames->hourCycle, jsNontrivialString(vm, m_hourCycle));
-        options->putDirect(vm, vm.propertyNames->hour12, jsBoolean(m_hourCycle == "h11" || m_hourCycle == "h12"));
-    }
-
     if (m_minute != Minute::None)
         options->putDirect(vm, vm.propertyNames->minute, jsNontrivialString(vm, minuteString(m_minute)));
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to