Bug 1634794 [wpt PR 23371] - WebIDL: Fix class string of null-prototype instance test, a=testonly
authorAlexey Shvayka <shvaikalesh@gmail.com>
Wed, 13 May 2020 04:00:03 +0000
changeset 531037 5f0b099b9eeebd0358417ae17fb5a00815a3e5d5
parent 531036 591dbff92d7ffe8983a1964898bc7fd464590eb9
child 531038 1f3078ff41f995331735d1846c9332ae70e1aff5
push id37435
push userapavel@mozilla.com
push dateWed, 20 May 2020 15:28:23 +0000
treeherdermozilla-central@5415da14ec9a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1634794, 23371, 23140
milestone78.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1634794 [wpt PR 23371] - WebIDL: Fix class string of null-prototype instance test, a=testonly Automatic update from web-platform-tests WebIDL: Fix class string of null-prototype instance test Follow-up of #23140. Spec: https://github.com/heycam/webidl/pull/357. -- wpt-commits: fca25d802d75842bd3ea9ed1c16ac341b18e4455 wpt-pr: 23371
testing/web-platform/tests/WebIDL/ecmascript-binding/class-string-iterator-prototype-object.any.js
--- a/testing/web-platform/tests/WebIDL/ecmascript-binding/class-string-iterator-prototype-object.any.js
+++ b/testing/web-platform/tests/WebIDL/ecmascript-binding/class-string-iterator-prototype-object.any.js
@@ -26,25 +26,33 @@ test(t => {
   Object.defineProperty(iteratorProto, Symbol.toStringTag, { value: "Not URLSearchParams Iterator" });
   assert_equals(Object.prototype.toString.call(iteratorProto), "[object Not URLSearchParams Iterator]");
 }, "Object.prototype.toString applied after modifying @@toStringTag");
 
 // Chrome had a bug (https://bugs.chromium.org/p/chromium/issues/detail?id=793406) where if there
 // was no @@toStringTag, it would fall back to a magic class string. This tests that the bug is
 // fixed.
 
+test(() => {
+  const iterator = (new URLSearchParams()).keys();
+  assert_equals(Object.prototype.toString.call(iterator), "[object URLSearchParams Iterator]");
+
+  Object.setPrototypeOf(iterator, null);
+  assert_equals(Object.prototype.toString.call(iterator), "[object Object]");
+}, "Object.prototype.toString applied to a null-prototype instance");
+
 test(t => {
   const proto = Object.getPrototypeOf(iteratorProto);
   t.add_cleanup(() => {
     Object.setPrototypeOf(iteratorProto, proto);
   });
 
   Object.setPrototypeOf(iteratorProto, null);
 
-  assert_equals(Object.prototype.toString.call(iteratorProto), "[object Object]");
+  assert_equals(Object.prototype.toString.call(iteratorProto), "[object URLSearchParams Iterator]");
 }, "Object.prototype.toString applied after nulling the prototype");
 
 // This test must be last.
 test(() => {
   delete iteratorProto[Symbol.toStringTag];
 
   assert_equals(Object.prototype.toString.call(iteratorProto), "[object Object]", "prototype");
 }, "Object.prototype.toString applied after deleting @@toStringTag");