From 629dd62127903d2e06959e850c3545c71b9262ef Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Mon, 25 Nov 2024 11:04:18 +0100 Subject: [PATCH] Require and assert that the global object inside the Shadow Realm is ordinary. (#413) Co-authored-by: Mathieu Hofman <86499+mhofman@users.noreply.github.com> --- spec.html | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/spec.html b/spec.html index da42053..ffab58e 100644 --- a/spec.html +++ b/spec.html @@ -497,6 +497,7 @@

ShadowRealm ( )

1. Let _realmRec_ be the Realm of _innerContext_. 1. Set _O_.[[ShadowRealm]] to _realmRec_. 1. Perform ? HostInitializeShadowRealm(_realmRec_, _innerContext_, _O_). + 1. Assert: _realmRec_.[[GlobalObject]] is an ordinary object. 1. Return _O_. @@ -612,10 +613,6 @@

to the ShadowRealm, e.g., for module loading. -

- The host may use this hook to add properties to the ShadowRealm's global - object. Those properties must be configurable. -

This specification does not recommend any specific addition. @@ -626,13 +623,13 @@

including `HTMLElement`, `localStorage`, `fetch`, etc.

- -

- The ShadowRealm constructor () - creates a new global object as an ordinary object. This - means all properties from the global object are deletable. -

-
+ + +

Requirements on host-defined global objects

+

+ If a host defines that a specific global object is to be used for a ShadowRealm, that + object must be an extensible ordinary object, and any properties on it must be configurable. +