Skip to content

Commit 052defa

Browse files
jmdyckljharb
authored andcommitted
Editorial: Tweak the return of SetDefaultGlobalBindings (#3139)
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~.
1 parent 977a6c4 commit 052defa

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

spec.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11622,8 +11622,8 @@ <h1>InitializeHostDefinedRealm ( ): either a normal completion containing ~unuse
1162211622
1. Let _thisValue_ be _global_.
1162311623
1. Set _realm_.[[GlobalObject]] to _global_.
1162411624
1. Set _realm_.[[GlobalEnv]] to NewGlobalEnvironment(_global_, _thisValue_).
11625-
1. Let _globalObj_ be ? SetDefaultGlobalBindings(_realm_).
11626-
1. Create any host-defined global object properties on _globalObj_.
11625+
1. Perform ? SetDefaultGlobalBindings(_realm_).
11626+
1. Create any host-defined global object properties on _global_.
1162711627
1. Return ~unused~.
1162811628
</emu-alg>
1162911629
</emu-clause>
@@ -11648,7 +11648,7 @@ <h1>
1164811648
<h1>
1164911649
SetDefaultGlobalBindings (
1165011650
_realmRec_: a Realm Record,
11651-
): either a normal completion containing an Object or a throw completion
11651+
): either a normal completion containing ~unused~ or a throw completion
1165211652
</h1>
1165311653
<dl class="header">
1165411654
</dl>
@@ -11658,7 +11658,7 @@ <h1>
1165811658
1. Let _name_ be the String value of the property name.
1165911659
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_.
1166011660
1. Perform ? DefinePropertyOrThrow(_global_, _name_, _desc_).
11661-
1. Return _global_.
11661+
1. Return ~unused~.
1166211662
</emu-alg>
1166311663
</emu-clause>
1166411664
</emu-clause>

0 commit comments

Comments
 (0)