Title: [234202] trunk
Revision
234202
Author
commit-qu...@webkit.org
Date
2018-07-25 10:02:28 -0700 (Wed, 25 Jul 2018)

Log Message

[INTL] Intl constructor lengths should be configurable
https://bugs.webkit.org/show_bug.cgi?id=187960

Patch by Andy VanWagoner <andy@vanwagoner.family> on 2018-07-25
Reviewed by Saam Barati.

JSTests:

Removed fixed length expectations, and updated Intl.Locale expectations
that error differently since r234127.

* test262/expectations.yaml:

Source/_javascript_Core:

Removed DontDelete from Intl constructor lengths.
Fixed DateTimeFormat formatToParts length.

* runtime/IntlCollatorConstructor.cpp:
(JSC::IntlCollatorConstructor::finishCreation):
* runtime/IntlDateTimeFormatConstructor.cpp:
(JSC::IntlDateTimeFormatConstructor::finishCreation):
* runtime/IntlDateTimeFormatPrototype.cpp:
(JSC::IntlDateTimeFormatPrototype::finishCreation):
* runtime/IntlNumberFormatConstructor.cpp:
(JSC::IntlNumberFormatConstructor::finishCreation):
* runtime/IntlPluralRulesConstructor.cpp:
(JSC::IntlPluralRulesConstructor::finishCreation):

LayoutTests:

Expect DateTimeFormat formatToParts length to be 1.

* js/intl-datetimeformat-expected.txt:
* js/script-tests/intl-datetimeformat.js:

Modified Paths

Diff

Modified: trunk/JSTests/ChangeLog (234201 => 234202)


--- trunk/JSTests/ChangeLog	2018-07-25 17:00:46 UTC (rev 234201)
+++ trunk/JSTests/ChangeLog	2018-07-25 17:02:28 UTC (rev 234202)
@@ -1,3 +1,15 @@
+2018-07-25  Andy VanWagoner  <andy@vanwagoner.family>
+
+        [INTL] Intl constructor lengths should be configurable
+        https://bugs.webkit.org/show_bug.cgi?id=187960
+
+        Reviewed by Saam Barati.
+
+        Removed fixed length expectations, and updated Intl.Locale expectations
+        that error differently since r234127.
+
+        * test262/expectations.yaml:
+
 2018-07-24  Commit Queue  <commit-qu...@webkit.org>
 
         Unreviewed, rolling out r234183.

Modified: trunk/JSTests/test262/expectations.yaml (234201 => 234202)


--- trunk/JSTests/test262/expectations.yaml	2018-07-25 17:00:46 UTC (rev 234201)
+++ trunk/JSTests/test262/expectations.yaml	2018-07-25 17:02:28 UTC (rev 234202)
@@ -1465,21 +1465,12 @@
 test/harness/assert-throws-early-referenceerror.js:
   default: 'Test262Error: Function: 1 = 1; Expected a ReferenceError to be thrown but no exception was thrown at all'
   strict mode: 'Test262Error: Function: 1 = 1; Expected a ReferenceError to be thrown but no exception was thrown at all'
-test/intl402/Collator/length.js:
-  default: 'Test262Error: Expected obj[length] to have configurable:true.'
-  strict mode: 'Test262Error: Expected obj[length] to have configurable:true.'
 test/intl402/Collator/prototype/compare/compare-function-name.js:
   default: 'Test262Error: Expected SameValue(«true», «false») to be true'
   strict mode: 'Test262Error: Expected SameValue(«true», «false») to be true'
-test/intl402/DateTimeFormat/length.js:
-  default: 'Test262Error: Expected obj[length] to have configurable:true.'
-  strict mode: 'Test262Error: Expected obj[length] to have configurable:true.'
 test/intl402/DateTimeFormat/prototype/format/format-function-name.js:
   default: 'Test262Error: Expected SameValue(«true», «false») to be true'
   strict mode: 'Test262Error: Expected SameValue(«true», «false») to be true'
-test/intl402/DateTimeFormat/prototype/formatToParts/length.js:
-  default: 'Test262Error: Expected SameValue(«0», «1») to be true'
-  strict mode: 'Test262Error: Expected SameValue(«0», «1») to be true'
 test/intl402/DateTimeFormat/prototype/resolvedOptions/hourCycle.js:
   default: 'Test262Error: Expected SameValue(«undefined», «h11») to be true'
   strict mode: 'Test262Error: Expected SameValue(«undefined», «h11») to be true'
@@ -1499,8 +1490,8 @@
   default: "TypeError: undefined is not a constructor (evaluating 'new Intl.Locale(\"en-US\")')"
   strict mode: "TypeError: undefined is not a constructor (evaluating 'new Intl.Locale(\"en-US\")')"
 test/intl402/Locale/constructor-non-iana-canon.js:
-  default: 'Test262Error: Expected SameValue(«mo», «ro») to be true'
-  strict mode: 'Test262Error: Expected SameValue(«mo», «ro») to be true'
+  default: "TypeError: undefined is not a constructor (evaluating 'new Intl.Locale(tag)')"
+  strict mode: "TypeError: undefined is not a constructor (evaluating 'new Intl.Locale(tag)')"
 test/intl402/Locale/constructor-options-calendar-invalid.js:
   default: 'Test262Error:  is an invalid calendar option value Expected a RangeError but got a TypeError'
   strict mode: 'Test262Error:  is an invalid calendar option value Expected a RangeError but got a TypeError'
@@ -1604,8 +1595,8 @@
   default: "TypeError: undefined is not an object (evaluating 'Object.getOwnPropertyDescriptor(obj, name)')"
   strict mode: "TypeError: undefined is not an object (evaluating 'Object.getOwnPropertyDescriptor(obj, name)')"
 test/intl402/Locale/likely-subtags-grandfathered.js:
-  default: 'Test262Error: Expected SameValue(«en-GB-oed», «en-GB-oxendict») to be true'
-  strict mode: 'Test262Error: Expected SameValue(«en-GB-oed», «en-GB-oxendict») to be true'
+  default: "TypeError: undefined is not a constructor (evaluating 'new Intl.Locale(tag)')"
+  strict mode: "TypeError: undefined is not a constructor (evaluating 'new Intl.Locale(tag)')"
 test/intl402/Locale/likely-subtags.js:
   default: "TypeError: undefined is not a constructor (evaluating 'new Intl.Locale(maximal)')"
   strict mode: "TypeError: undefined is not a constructor (evaluating 'new Intl.Locale(maximal)')"
@@ -1744,9 +1735,6 @@
 test/intl402/Locale/prototype/toStringTag/toStringTag.js:
   default: "TypeError: undefined is not an object (evaluating 'Intl.Locale.prototype')"
   strict mode: "TypeError: undefined is not an object (evaluating 'Intl.Locale.prototype')"
-test/intl402/NumberFormat/length.js:
-  default: 'Test262Error: descriptor should be configurable'
-  strict mode: 'Test262Error: descriptor should be configurable'
 test/intl402/NumberFormat/prototype/format/format-fraction-digits.js:
   default: 'Test262Error: Formatted value for 12344501000000000000000000000000000, en-US-u-nu-arab and options {"useGrouping":false,"minimumIntegerDigits":3,"minimumFractionDigits":1,"maximumFractionDigits":3} is ١٢٣٤٤٥٠١٠٠٠٠٠٠٠٠٠٠٠٠٠٠٠٠٠٠٠٠٠٠٠٠٠٠٠٫٠; expected ١٢٣٤٤٥٠١٠٠٠٠٠٠٠٠٠٤٨٧٨١٥٤٤٤٦٧٨٣١١٩٣٦٫٠.'
   strict mode: 'Test262Error: Formatted value for 12344501000000000000000000000000000, en-US-u-nu-arab and options {"useGrouping":false,"minimumIntegerDigits":3,"minimumFractionDigits":1,"maximumFractionDigits":3} is ١٢٣٤٤٥٠١٠٠٠٠٠٠٠٠٠٠٠٠٠٠٠٠٠٠٠٠٠٠٠٠٠٠٠٫٠; expected ١٢٣٤٤٥٠١٠٠٠٠٠٠٠٠٠٤٨٧٨١٥٤٤٤٦٧٨٣١١٩٣٦٫٠.'
@@ -1774,9 +1762,6 @@
 test/intl402/NumberFormat/prototype/formatToParts/return-abrupt-tonumber.js:
   default: 'Test262Error: valueOf Expected a Test262Error but got a TypeError'
   strict mode: 'Test262Error: valueOf Expected a Test262Error but got a TypeError'
-test/intl402/PluralRules/length.js:
-  default: 'Test262Error: descriptor should be configurable'
-  strict mode: 'Test262Error: descriptor should be configurable'
 test/intl402/PluralRules/prototype/resolvedOptions/pluralCategories.js:
   default: 'Test262Error: Should have different arrays Expected SameValue(«undefined», «undefined») to be false'
   strict mode: 'Test262Error: Should have different arrays Expected SameValue(«undefined», «undefined») to be false'

Modified: trunk/LayoutTests/ChangeLog (234201 => 234202)


--- trunk/LayoutTests/ChangeLog	2018-07-25 17:00:46 UTC (rev 234201)
+++ trunk/LayoutTests/ChangeLog	2018-07-25 17:02:28 UTC (rev 234202)
@@ -1,3 +1,15 @@
+2018-07-25  Andy VanWagoner  <andy@vanwagoner.family>
+
+        [INTL] Intl constructor lengths should be configurable
+        https://bugs.webkit.org/show_bug.cgi?id=187960
+
+        Reviewed by Saam Barati.
+
+        Expect DateTimeFormat formatToParts length to be 1.
+
+        * js/intl-datetimeformat-expected.txt:
+        * js/script-tests/intl-datetimeformat.js:
+
 2018-07-25  Ms2ger  <ms2...@igalia.com>
 
         [GTK][WPE] Unreviewed test gardening

Modified: trunk/LayoutTests/js/intl-datetimeformat-expected.txt (234201 => 234202)


--- trunk/LayoutTests/js/intl-datetimeformat-expected.txt	2018-07-25 17:00:46 UTC (rev 234201)
+++ trunk/LayoutTests/js/intl-datetimeformat-expected.txt	2018-07-25 17:02:28 UTC (rev 234202)
@@ -2111,7 +2111,7 @@
 PASS var legacy = Object.create(Intl.DateTimeFormat.prototype);Intl.DateTimeFormat.call(legacy, 'en-u-nu-arab', { timeZone: 'America/Los_Angeles' }).format(1451099872641) is '١٢/٢٥/٢٠١٥'
 PASS var incompat = {};Intl.DateTimeFormat.apply(incompat) is not incompat
 PASS Intl.DateTimeFormat.prototype.formatToParts is an instance of Function
-PASS Intl.DateTimeFormat.prototype.formatToParts.length is 0
+PASS Intl.DateTimeFormat.prototype.formatToParts.length is 1
 PASS Object.getOwnPropertyDescriptor(Intl.DateTimeFormat.prototype, 'formatToParts').writable is true
 PASS Object.getOwnPropertyDescriptor(Intl.DateTimeFormat.prototype, 'formatToParts').enumerable is false
 PASS Object.getOwnPropertyDescriptor(Intl.DateTimeFormat.prototype, 'formatToParts').configurable is true

Modified: trunk/LayoutTests/js/script-tests/intl-datetimeformat.js (234201 => 234202)


--- trunk/LayoutTests/js/script-tests/intl-datetimeformat.js	2018-07-25 17:00:46 UTC (rev 234201)
+++ trunk/LayoutTests/js/script-tests/intl-datetimeformat.js	2018-07-25 17:02:28 UTC (rev 234202)
@@ -501,7 +501,7 @@
 
 // ECMA-402 4th edition 15.4 Intl.DateTimeFormat.prototype.formatToParts
 shouldBeType("Intl.DateTimeFormat.prototype.formatToParts", "Function");
-shouldBe("Intl.DateTimeFormat.prototype.formatToParts.length", "0");
+shouldBe("Intl.DateTimeFormat.prototype.formatToParts.length", "1");
 shouldBeTrue("Object.getOwnPropertyDescriptor(Intl.DateTimeFormat.prototype, 'formatToParts').writable");
 shouldBeFalse("Object.getOwnPropertyDescriptor(Intl.DateTimeFormat.prototype, 'formatToParts').enumerable");
 shouldBeTrue("Object.getOwnPropertyDescriptor(Intl.DateTimeFormat.prototype, 'formatToParts').configurable");

Modified: trunk/Source/_javascript_Core/ChangeLog (234201 => 234202)


--- trunk/Source/_javascript_Core/ChangeLog	2018-07-25 17:00:46 UTC (rev 234201)
+++ trunk/Source/_javascript_Core/ChangeLog	2018-07-25 17:02:28 UTC (rev 234202)
@@ -1,3 +1,24 @@
+2018-07-25  Andy VanWagoner  <andy@vanwagoner.family>
+
+        [INTL] Intl constructor lengths should be configurable
+        https://bugs.webkit.org/show_bug.cgi?id=187960
+
+        Reviewed by Saam Barati.
+
+        Removed DontDelete from Intl constructor lengths.
+        Fixed DateTimeFormat formatToParts length.
+
+        * runtime/IntlCollatorConstructor.cpp:
+        (JSC::IntlCollatorConstructor::finishCreation):
+        * runtime/IntlDateTimeFormatConstructor.cpp:
+        (JSC::IntlDateTimeFormatConstructor::finishCreation):
+        * runtime/IntlDateTimeFormatPrototype.cpp:
+        (JSC::IntlDateTimeFormatPrototype::finishCreation):
+        * runtime/IntlNumberFormatConstructor.cpp:
+        (JSC::IntlNumberFormatConstructor::finishCreation):
+        * runtime/IntlPluralRulesConstructor.cpp:
+        (JSC::IntlPluralRulesConstructor::finishCreation):
+
 2018-07-24  Fujii Hironori  <hironori.fu...@sony.com>
 
         runJITThreadLimitTests is failing

Modified: trunk/Source/_javascript_Core/runtime/IntlCollatorConstructor.cpp (234201 => 234202)


--- trunk/Source/_javascript_Core/runtime/IntlCollatorConstructor.cpp	2018-07-25 17:00:46 UTC (rev 234201)
+++ trunk/Source/_javascript_Core/runtime/IntlCollatorConstructor.cpp	2018-07-25 17:02:28 UTC (rev 234202)
@@ -81,7 +81,7 @@
 {
     Base::finishCreation(vm, "Collator"_s);
     putDirectWithoutTransition(vm, vm.propertyNames->prototype, collatorPrototype, PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly);
-    putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(0), PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum | PropertyAttribute::DontDelete);
+    putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(0), PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum);
     collatorPrototype->putDirectWithoutTransition(vm, vm.propertyNames->constructor, this, static_cast<unsigned>(PropertyAttribute::DontEnum));
     m_collatorStructure.set(vm, this, collatorStructure);
 }

Modified: trunk/Source/_javascript_Core/runtime/IntlDateTimeFormatConstructor.cpp (234201 => 234202)


--- trunk/Source/_javascript_Core/runtime/IntlDateTimeFormatConstructor.cpp	2018-07-25 17:00:46 UTC (rev 234201)
+++ trunk/Source/_javascript_Core/runtime/IntlDateTimeFormatConstructor.cpp	2018-07-25 17:02:28 UTC (rev 234202)
@@ -81,7 +81,7 @@
 {
     Base::finishCreation(vm, "DateTimeFormat"_s);
     putDirectWithoutTransition(vm, vm.propertyNames->prototype, dateTimeFormatPrototype, PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly);
-    putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(0), PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum | PropertyAttribute::DontDelete);
+    putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(0), PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum);
     dateTimeFormatPrototype->putDirectWithoutTransition(vm, vm.propertyNames->constructor, this, static_cast<unsigned>(PropertyAttribute::DontEnum));
     m_dateTimeFormatStructure.set(vm, this, dateTimeFormatStructure);
 }

Modified: trunk/Source/_javascript_Core/runtime/IntlDateTimeFormatPrototype.cpp (234201 => 234202)


--- trunk/Source/_javascript_Core/runtime/IntlDateTimeFormatPrototype.cpp	2018-07-25 17:00:46 UTC (rev 234201)
+++ trunk/Source/_javascript_Core/runtime/IntlDateTimeFormatPrototype.cpp	2018-07-25 17:02:28 UTC (rev 234202)
@@ -83,7 +83,7 @@
 {
     Base::finishCreation(vm);
 #if JSC_ICU_HAS_UFIELDPOSITER
-    JSFunction* formatToPartsFunction = JSFunction::create(vm, globalObject, 0, vm.propertyNames->formatToParts.string(), IntlDateTimeFormatPrototypeFuncFormatToParts);
+    JSFunction* formatToPartsFunction = JSFunction::create(vm, globalObject, 1, vm.propertyNames->formatToParts.string(), IntlDateTimeFormatPrototypeFuncFormatToParts);
     putDirectWithoutTransition(vm, vm.propertyNames->formatToParts, formatToPartsFunction, static_cast<unsigned>(PropertyAttribute::DontEnum));
 #else
     UNUSED_PARAM(globalObject);

Modified: trunk/Source/_javascript_Core/runtime/IntlNumberFormatConstructor.cpp (234201 => 234202)


--- trunk/Source/_javascript_Core/runtime/IntlNumberFormatConstructor.cpp	2018-07-25 17:00:46 UTC (rev 234201)
+++ trunk/Source/_javascript_Core/runtime/IntlNumberFormatConstructor.cpp	2018-07-25 17:02:28 UTC (rev 234202)
@@ -81,7 +81,7 @@
 {
     Base::finishCreation(vm, "NumberFormat"_s);
     putDirectWithoutTransition(vm, vm.propertyNames->prototype, numberFormatPrototype, PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly);
-    putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(0), PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum | PropertyAttribute::DontDelete);
+    putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(0), PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum);
     numberFormatPrototype->putDirectWithoutTransition(vm, vm.propertyNames->constructor, this, static_cast<unsigned>(PropertyAttribute::DontEnum));
     m_numberFormatStructure.set(vm, this, numberFormatStructure);
 }

Modified: trunk/Source/_javascript_Core/runtime/IntlPluralRulesConstructor.cpp (234201 => 234202)


--- trunk/Source/_javascript_Core/runtime/IntlPluralRulesConstructor.cpp	2018-07-25 17:00:46 UTC (rev 234201)
+++ trunk/Source/_javascript_Core/runtime/IntlPluralRulesConstructor.cpp	2018-07-25 17:02:28 UTC (rev 234202)
@@ -79,7 +79,7 @@
 {
     Base::finishCreation(vm, "PluralRules"_s);
     putDirectWithoutTransition(vm, vm.propertyNames->prototype, pluralRulesPrototype, PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly);
-    putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(0), PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum | PropertyAttribute::DontDelete);
+    putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(0), PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum);
     pluralRulesPrototype->putDirectWithoutTransition(vm, vm.propertyNames->constructor, this, static_cast<unsigned>(PropertyAttribute::DontEnum));
     m_pluralRulesStructure.set(vm, this, pluralRulesStructure);
 }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to