Title: [262568] trunk
Revision
262568
Author
[email protected]
Date
2020-06-04 14:01:26 -0700 (Thu, 04 Jun 2020)

Log Message

Intl classes should have meaningful @@toStringTag values
https://bugs.webkit.org/show_bug.cgi?id=212769

Reviewed by Yusuke Suzuki.

JSTests:

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

* stress/intl-collator.js:
* stress/intl-datetimeformat.js:
* stress/intl-numberformat.js:
* stress/intl-pluralrules.js:
Update stress tests.

Source/_javascript_Core:

Implementation of https://github.com/tc39/ecma402/pull/430, which achieved consensus this week.
This ensures we get "[object Intl.Collator]" (etc.) instead "[object Object]" for older Intl classes.

* runtime/IntlCollatorPrototype.cpp:
* runtime/IntlDateTimeFormatPrototype.cpp:
* runtime/IntlNumberFormatPrototype.cpp:
* runtime/IntlPluralRulesPrototype.cpp:

Modified Paths

Diff

Modified: trunk/JSTests/ChangeLog (262567 => 262568)


--- trunk/JSTests/ChangeLog	2020-06-04 20:49:22 UTC (rev 262567)
+++ trunk/JSTests/ChangeLog	2020-06-04 21:01:26 UTC (rev 262568)
@@ -1,3 +1,19 @@
+2020-06-04  Ross Kirsling  <[email protected]>
+
+        Intl classes should have meaningful @@toStringTag values
+        https://bugs.webkit.org/show_bug.cgi?id=212769
+
+        Reviewed by Yusuke Suzuki.
+
+        * test262/expectations.yaml:
+        Mark 16 test cases as passing.
+
+        * stress/intl-collator.js:
+        * stress/intl-datetimeformat.js:
+        * stress/intl-numberformat.js:
+        * stress/intl-pluralrules.js:
+        Update stress tests.
+
 2020-06-04  Alexey Shvayka  <[email protected]>
 
         GetMethod isn't performed properly on iterators

Modified: trunk/JSTests/stress/intl-collator.js (262567 => 262568)


--- trunk/JSTests/stress/intl-collator.js	2020-06-04 20:49:22 UTC (rev 262567)
+++ trunk/JSTests/stress/intl-collator.js	2020-06-04 21:01:26 UTC (rev 262568)
@@ -241,9 +241,9 @@
 shouldBe(Intl.Collator.prototype.constructor, Intl.Collator);
 
 // 10.3.2 Intl.Collator.prototype [ @@toStringTag ]
-// The initial value of the @@toStringTag property is the string value Object.
-shouldBe(Intl.Collator.prototype[Symbol.toStringTag], 'Object');
-shouldBe(Object.prototype.toString.call(Intl.Collator.prototype), '[object Object]');
+// The initial value of the @@toStringTag property is the string value "Intl.Collator".
+shouldBe(Intl.Collator.prototype[Symbol.toStringTag], 'Intl.Collator');
+shouldBe(Object.prototype.toString.call(Intl.Collator.prototype), '[object Intl.Collator]');
 // This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }.
 shouldBe(Object.getOwnPropertyDescriptor(Intl.Collator.prototype, Symbol.toStringTag).writable, false);
 shouldBe(Object.getOwnPropertyDescriptor(Intl.Collator.prototype, Symbol.toStringTag).enumerable, false);

Modified: trunk/JSTests/stress/intl-datetimeformat.js (262567 => 262568)


--- trunk/JSTests/stress/intl-datetimeformat.js	2020-06-04 20:49:22 UTC (rev 262567)
+++ trunk/JSTests/stress/intl-datetimeformat.js	2020-06-04 21:01:26 UTC (rev 262568)
@@ -137,9 +137,9 @@
 shouldBe(Intl.DateTimeFormat.prototype.constructor, Intl.DateTimeFormat);
 
 // 12.4.2 Intl.DateTimeFormat.prototype [ @@toStringTag ]
-// The initial value of the @@toStringTag property is the string value Object.
-shouldBe(Intl.DateTimeFormat.prototype[Symbol.toStringTag], 'Object');
-shouldBe(Object.prototype.toString.call(Intl.DateTimeFormat.prototype), '[object Object]');
+// The initial value of the @@toStringTag property is the string value "Intl.DateTimeFormat".
+shouldBe(Intl.DateTimeFormat.prototype[Symbol.toStringTag], 'Intl.DateTimeFormat');
+shouldBe(Object.prototype.toString.call(Intl.DateTimeFormat.prototype), '[object Intl.DateTimeFormat]');
 // This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }.
 shouldBe(Object.getOwnPropertyDescriptor(Intl.DateTimeFormat.prototype, Symbol.toStringTag).writable, false);
 shouldBe(Object.getOwnPropertyDescriptor(Intl.DateTimeFormat.prototype, Symbol.toStringTag).enumerable, false);

Modified: trunk/JSTests/stress/intl-numberformat.js (262567 => 262568)


--- trunk/JSTests/stress/intl-numberformat.js	2020-06-04 20:49:22 UTC (rev 262567)
+++ trunk/JSTests/stress/intl-numberformat.js	2020-06-04 21:01:26 UTC (rev 262568)
@@ -277,9 +277,9 @@
 shouldBe(Intl.NumberFormat.prototype.constructor, Intl.NumberFormat);
 
 // 11.4.2 Intl.NumberFormat.prototype [ @@toStringTag ]
-// The initial value of the @@toStringTag property is the string value Object.
-shouldBe(Intl.NumberFormat.prototype[Symbol.toStringTag], 'Object');
-shouldBe(Object.prototype.toString.call(Intl.NumberFormat.prototype), '[object Object]');
+// The initial value of the @@toStringTag property is the string value "Intl.NumberFormat".
+shouldBe(Intl.NumberFormat.prototype[Symbol.toStringTag], 'Intl.NumberFormat');
+shouldBe(Object.prototype.toString.call(Intl.NumberFormat.prototype), '[object Intl.NumberFormat]');
 // This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }.
 shouldBe(Object.getOwnPropertyDescriptor(Intl.NumberFormat.prototype, Symbol.toStringTag).writable, false);
 shouldBe(Object.getOwnPropertyDescriptor(Intl.NumberFormat.prototype, Symbol.toStringTag).enumerable, false);

Modified: trunk/JSTests/stress/intl-pluralrules.js (262567 => 262568)


--- trunk/JSTests/stress/intl-pluralrules.js	2020-06-04 20:49:22 UTC (rev 262567)
+++ trunk/JSTests/stress/intl-pluralrules.js	2020-06-04 21:01:26 UTC (rev 262568)
@@ -136,9 +136,9 @@
 shouldBe(Intl.PluralRules.prototype.constructor, Intl.PluralRules);
 
 // 13.4.2 Intl.PluralRules.prototype [ @@toStringTag ]
-// The initial value of the @@toStringTag property is the string value Object.
-shouldBe(Intl.PluralRules.prototype[Symbol.toStringTag], 'Object');
-shouldBe(Object.prototype.toString.call(Intl.PluralRules.prototype), '[object Object]');
+// The initial value of the @@toStringTag property is the string value "Intl.PluralRules".
+shouldBe(Intl.PluralRules.prototype[Symbol.toStringTag], 'Intl.PluralRules');
+shouldBe(Object.prototype.toString.call(Intl.PluralRules.prototype), '[object Intl.PluralRules]');
 // This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }.
 shouldBe(Object.getOwnPropertyDescriptor(Intl.PluralRules.prototype, Symbol.toStringTag).writable, false);
 shouldBe(Object.getOwnPropertyDescriptor(Intl.PluralRules.prototype, Symbol.toStringTag).enumerable, false);

Modified: trunk/JSTests/test262/expectations.yaml (262567 => 262568)


--- trunk/JSTests/test262/expectations.yaml	2020-06-04 20:49:22 UTC (rev 262567)
+++ trunk/JSTests/test262/expectations.yaml	2020-06-04 21:01:26 UTC (rev 262568)
@@ -1647,12 +1647,6 @@
 test/intl402/Collator/missing-unicode-ext-value-defaults-to-true.js:
   default: "Test262Error: \"kn-true\" is returned in locale, but shouldn't be. Expected SameValue(«7», «-1») to be true"
   strict mode: "Test262Error: \"kn-true\" is returned in locale, but shouldn't be. Expected SameValue(«7», «-1») to be true"
-test/intl402/Collator/prototype/toStringTag/toString.js:
-  default: 'Test262Error: Expected SameValue(«[object Object]», «[object Intl.Collator]») to be true'
-  strict mode: 'Test262Error: Expected SameValue(«[object Object]», «[object Intl.Collator]») to be true'
-test/intl402/Collator/prototype/toStringTag/toStringTag.js:
-  default: 'Test262Error: descriptor value should be Intl.Collator'
-  strict mode: 'Test262Error: descriptor value should be Intl.Collator'
 test/intl402/Collator/usage-de.js:
   default: 'Test262Error: Expected [Ä, AE] and [AE, Ä] to have the same contents. search'
   strict mode: 'Test262Error: Expected [Ä, AE] and [AE, Ä] to have the same contents. search'
@@ -1659,12 +1653,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/DateTimeFormat/prototype/toStringTag/toString.js:
-  default: 'Test262Error: Expected SameValue(«[object Object]», «[object Intl.DateTimeFormat]») to be true'
-  strict mode: 'Test262Error: Expected SameValue(«[object Object]», «[object Intl.DateTimeFormat]») to be true'
-test/intl402/DateTimeFormat/prototype/toStringTag/toStringTag.js:
-  default: 'Test262Error: descriptor value should be Intl.DateTimeFormat'
-  strict mode: 'Test262Error: descriptor value should be Intl.DateTimeFormat'
 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'
@@ -1758,18 +1746,6 @@
 test/intl402/Locale/prototype/minimize/removing-likely-subtags-first-adds-likely-subtags.js:
   default: 'Test262Error: "und".minimize() should be "en" Expected SameValue(«en-u-va-posix», «en») to be true'
   strict mode: 'Test262Error: "und".minimize() should be "en" Expected SameValue(«en-u-va-posix», «en») to be true'
-test/intl402/NumberFormat/prototype/toStringTag/configurable.js:
-  default: 'Test262Error: Expected SameValue(«Object», «Intl.NumberFormat») to be true'
-  strict mode: 'Test262Error: Expected SameValue(«Object», «Intl.NumberFormat») to be true'
-test/intl402/NumberFormat/prototype/toStringTag/prop-desc.js:
-  default: 'Test262Error: descriptor value should be Intl.NumberFormat'
-  strict mode: 'Test262Error: descriptor value should be Intl.NumberFormat'
-test/intl402/PluralRules/prototype/toStringTag/toString.js:
-  default: 'Test262Error: Expected SameValue(«[object Object]», «[object Intl.PluralRules]») to be true'
-  strict mode: 'Test262Error: Expected SameValue(«[object Object]», «[object Intl.PluralRules]») to be true'
-test/intl402/PluralRules/prototype/toStringTag/toStringTag.js:
-  default: 'Test262Error: descriptor value should be Intl.PluralRules'
-  strict mode: 'Test262Error: descriptor value should be Intl.PluralRules'
 test/intl402/RelativeTimeFormat/constructor/constructor/locales-valid.js:
   default: 'Test262Error: Grandfathered Expected a RangeError to be thrown but no exception was thrown at all'
   strict mode: 'Test262Error: Grandfathered Expected a RangeError to be thrown but no exception was thrown at all'

Modified: trunk/Source/_javascript_Core/ChangeLog (262567 => 262568)


--- trunk/Source/_javascript_Core/ChangeLog	2020-06-04 20:49:22 UTC (rev 262567)
+++ trunk/Source/_javascript_Core/ChangeLog	2020-06-04 21:01:26 UTC (rev 262568)
@@ -1,3 +1,18 @@
+2020-06-04  Ross Kirsling  <[email protected]>
+
+        Intl classes should have meaningful @@toStringTag values
+        https://bugs.webkit.org/show_bug.cgi?id=212769
+
+        Reviewed by Yusuke Suzuki.
+
+        Implementation of https://github.com/tc39/ecma402/pull/430, which achieved consensus this week.
+        This ensures we get "[object Intl.Collator]" (etc.) instead "[object Object]" for older Intl classes.
+
+        * runtime/IntlCollatorPrototype.cpp:
+        * runtime/IntlDateTimeFormatPrototype.cpp:
+        * runtime/IntlNumberFormatPrototype.cpp:
+        * runtime/IntlPluralRulesPrototype.cpp:
+
 2020-06-04  Alexey Shvayka  <[email protected]>
 
         GetMethod isn't performed properly on iterators

Modified: trunk/Source/_javascript_Core/runtime/IntlCollatorPrototype.cpp (262567 => 262568)


--- trunk/Source/_javascript_Core/runtime/IntlCollatorPrototype.cpp	2020-06-04 20:49:22 UTC (rev 262567)
+++ trunk/Source/_javascript_Core/runtime/IntlCollatorPrototype.cpp	2020-06-04 21:01:26 UTC (rev 262568)
@@ -42,7 +42,7 @@
 
 namespace JSC {
 
-const ClassInfo IntlCollatorPrototype::s_info = { "Object", &Base::s_info, &collatorPrototypeTable, nullptr, CREATE_METHOD_TABLE(IntlCollatorPrototype) };
+const ClassInfo IntlCollatorPrototype::s_info = { "Intl.Collator", &Base::s_info, &collatorPrototypeTable, nullptr, CREATE_METHOD_TABLE(IntlCollatorPrototype) };
 
 /* Source for IntlCollatorPrototype.lut.h
 @begin collatorPrototypeTable

Modified: trunk/Source/_javascript_Core/runtime/IntlDateTimeFormatPrototype.cpp (262567 => 262568)


--- trunk/Source/_javascript_Core/runtime/IntlDateTimeFormatPrototype.cpp	2020-06-04 20:49:22 UTC (rev 262567)
+++ trunk/Source/_javascript_Core/runtime/IntlDateTimeFormatPrototype.cpp	2020-06-04 21:01:26 UTC (rev 262568)
@@ -46,7 +46,7 @@
 
 namespace JSC {
 
-const ClassInfo IntlDateTimeFormatPrototype::s_info = { "Object", &Base::s_info, &dateTimeFormatPrototypeTable, nullptr, CREATE_METHOD_TABLE(IntlDateTimeFormatPrototype) };
+const ClassInfo IntlDateTimeFormatPrototype::s_info = { "Intl.DateTimeFormat", &Base::s_info, &dateTimeFormatPrototypeTable, nullptr, CREATE_METHOD_TABLE(IntlDateTimeFormatPrototype) };
 
 /* Source for IntlDateTimeFormatPrototype.lut.h
 @begin dateTimeFormatPrototypeTable

Modified: trunk/Source/_javascript_Core/runtime/IntlNumberFormatPrototype.cpp (262567 => 262568)


--- trunk/Source/_javascript_Core/runtime/IntlNumberFormatPrototype.cpp	2020-06-04 20:49:22 UTC (rev 262567)
+++ trunk/Source/_javascript_Core/runtime/IntlNumberFormatPrototype.cpp	2020-06-04 21:01:26 UTC (rev 262568)
@@ -44,7 +44,7 @@
 
 namespace JSC {
 
-const ClassInfo IntlNumberFormatPrototype::s_info = { "Object", &Base::s_info, &numberFormatPrototypeTable, nullptr, CREATE_METHOD_TABLE(IntlNumberFormatPrototype) };
+const ClassInfo IntlNumberFormatPrototype::s_info = { "Intl.NumberFormat", &Base::s_info, &numberFormatPrototypeTable, nullptr, CREATE_METHOD_TABLE(IntlNumberFormatPrototype) };
 
 /* Source for IntlNumberFormatPrototype.lut.h
 @begin numberFormatPrototypeTable

Modified: trunk/Source/_javascript_Core/runtime/IntlPluralRulesPrototype.cpp (262567 => 262568)


--- trunk/Source/_javascript_Core/runtime/IntlPluralRulesPrototype.cpp	2020-06-04 20:49:22 UTC (rev 262567)
+++ trunk/Source/_javascript_Core/runtime/IntlPluralRulesPrototype.cpp	2020-06-04 21:01:26 UTC (rev 262568)
@@ -41,7 +41,7 @@
 
 namespace JSC {
 
-const ClassInfo IntlPluralRulesPrototype::s_info = { "Object", &Base::s_info, &pluralRulesPrototypeTable, nullptr, CREATE_METHOD_TABLE(IntlPluralRulesPrototype) };
+const ClassInfo IntlPluralRulesPrototype::s_info = { "Intl.PluralRules", &Base::s_info, &pluralRulesPrototypeTable, nullptr, CREATE_METHOD_TABLE(IntlPluralRulesPrototype) };
 
 /* Source for IntlPluralRulesPrototype.lut.h
 @begin pluralRulesPrototypeTable
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to