Skip to content

Commit

Permalink
Editorial: Tweak the return of SetDefaultGlobalBindings (#3139)
Browse files Browse the repository at this point in the history
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~.
  • Loading branch information
jmdyck authored and ljharb committed May 23, 2024
1 parent 977a6c4 commit 052defa
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -11622,8 +11622,8 @@ <h1>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~.
</emu-alg>
</emu-clause>
Expand All @@ -11648,7 +11648,7 @@ <h1>
<h1>
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
</h1>
<dl class="header">
</dl>
Expand All @@ -11658,7 +11658,7 @@ <h1>
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 <emu-xref href="#sec-function-properties-of-the-global-object"></emu-xref>, <emu-xref href="#sec-constructor-properties-of-the-global-object"></emu-xref>, or <emu-xref href="#sec-other-properties-of-the-global-object"></emu-xref> 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~.
</emu-alg>
</emu-clause>
</emu-clause>
Expand Down

0 comments on commit 052defa

Please sign in to comment.