From 8e7c74d02014db57c66b55342e594315a2479891 Mon Sep 17 00:00:00 2001
From: Ms2ger <Ms2ger@gmail.com>
Date: Fri, 15 Nov 2024 16:10:30 +0100
Subject: [PATCH] Avoid installing the [[SetPrototypeOf]] hook for the shadow
 realms global

---
 index.bs | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/index.bs b/index.bs
index 7e43de24..62d6802c 100644
--- a/index.bs
+++ b/index.bs
@@ -11841,8 +11841,7 @@ is the concatenation of the [=interface=]'s
     When the \[[SetPrototypeOf]] internal method of a [=named properties object=] |O| is called with
     JavaScript language value |V|, the following step is taken:
 
-    1.  If |O|'s [=associated realm=]'s [=is global prototype chain mutable=] is true,
-        return [=?=] [$OrdinarySetPrototypeOf$](|O|, |V|).
+    1.  Assert: |O|'s [=associated realm=]'s [=is global prototype chain mutable=] is false.
     1.  Return [=?=] <a abstract-op>SetImmutablePrototype</a>(|O|, |V|).
 
 </div>
@@ -13552,7 +13551,8 @@ the realm given as an argument.
         1.  [=Define the iteration methods=] of |interface| on |instance| given |realm|.
         1.  [=Define the asynchronous iteration methods=] of |interface| on |instance| given |realm|.
         1.  [=Define the global property references=] on |instance|, given |realm|.
-        1.  Set |instance|.\[[SetPrototypeOf]] as defined in [[#platform-object-setprototypeof]].
+        1.  If |realm|'s [=is global prototype chain mutable=] is false, then:
+            1.  Set |instance|.\[[SetPrototypeOf]] as defined in [[#platform-object-setprototypeof]].
     1.  Otherwise, if |interfaces| contains an [=interface=] which
         [=support indexed properties|supports indexed properties=],
         [=support named properties|named properties=], or both:
@@ -13661,8 +13661,7 @@ Issue: Define those properties imperatively instead.
     [=interface=] with the [{{Global}}] [=extended attribute=] is called with
     JavaScript language value |V|, the following step is taken:
 
-    1.  If |O|'s [=associated realm=]'s [=is global prototype chain mutable=] is true,
-        return [=?=] [$OrdinarySetPrototypeOf$](|O|, |V|).
+    1.  Assert: |O|'s [=associated realm=]'s [=is global prototype chain mutable=] is false.
     1.  Return [=?=] <a abstract-op>SetImmutablePrototype</a>(|O|, |V|).
 
 </div>