From 6a5342c270b2658bffd4203c6c989f87168f29f7 Mon Sep 17 00:00:00 2001 From: Michael Dyck Date: Wed, 2 Aug 2023 15:48:27 -0400 Subject: [PATCH] Editorial: Tweak the return of `SetDefaultGlobalBindings` In the status quo, the value returned by SetDefaultGlobalBindings is always just the [[GlobalObject]] of the Realm Record passed in. At the only invocation of SetDefaultGlobalBindings (in InitializeHostDefinedRealm), this is `_realm_.[[GlobalObject]]`, which is just `_global_`. So use `_global_` instead of `_globalObj_` (the alias for the value returned by SetDefaultGlobalBindings), and tweak SetDefaultGlobalBindings to return ~unused~. --- spec.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spec.html b/spec.html index 98cf70b8e0..1f646a4bd7 100644 --- a/spec.html +++ b/spec.html @@ -11622,8 +11622,8 @@

InitializeHostDefinedRealm ( ): either a normal completion containing ~unuse 1. Let _thisValue_ be _global_. 1. Set _realm_.[[GlobalObject]] to _global_. 1. Set _realm_.[[GlobalEnv]] to NewGlobalEnvironment(_global_, _thisValue_). - 1. Let _globalObj_ be ? SetDefaultGlobalBindings(_realm_). - 1. Create any host-defined global object properties on _globalObj_. + 1. Perform ? SetDefaultGlobalBindings(_realm_). + 1. Create any host-defined global object properties on _global_. 1. Return ~unused~. @@ -11648,7 +11648,7 @@

SetDefaultGlobalBindings ( _realmRec_: a Realm Record, - ): either a normal completion containing an Object or a throw completion + ): either a normal completion containing ~unused~ or a throw completion

@@ -11658,7 +11658,7 @@

1. Let _name_ be the String value of the property name. 1. Let _desc_ be the fully populated data Property Descriptor for the property, containing the specified attributes for the property. For properties listed in , , or the value of the [[Value]] attribute is the corresponding intrinsic object from _realmRec_. 1. Perform ? DefinePropertyOrThrow(_global_, _name_, _desc_). - 1. Return _global_. + 1. Return ~unused~.