Skip to content

Commit

Permalink
more likely-incorrect environment record return types
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelficarra committed Nov 13, 2021
1 parent 5a9fe05 commit 0cbd188
Showing 1 changed file with 34 additions and 32 deletions.
66 changes: 34 additions & 32 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -10811,7 +10811,7 @@ <h1>Global Environment Records</h1>
<h1>
HasBinding (
_N_: a String,
)
): a Completion Record normally containing a Boolean
</h1>
<dl class="header">
<dt>for</dt>
Expand All @@ -10833,7 +10833,7 @@ <h1>
CreateMutableBinding (
_N_: a String,
_D_: a Boolean,
)
): a Completion Record normally containing ~unused~
</h1>
<dl class="header">
<dt>for</dt>
Expand All @@ -10854,7 +10854,7 @@ <h1>
CreateImmutableBinding (
_N_: a String,
_S_: a Boolean,
)
): a Completion Record normally containing ~unused~
</h1>
<dl class="header">
<dt>for</dt>
Expand All @@ -10875,7 +10875,7 @@ <h1>
InitializeBinding (
_N_: a String,
_V_: an ECMAScript language value,
)
): a Completion Record normally containing ~unused~
</h1>
<dl class="header">
<dt>for</dt>
Expand All @@ -10890,7 +10890,8 @@ <h1>
1. Return _DclRec_.InitializeBinding(_N_, _V_).
1. Assert: If the binding exists, it must be in the object Environment Record.
1. Let _ObjRec_ be _envRec_.[[ObjectRecord]].
1. Return ? _ObjRec_.InitializeBinding(_N_, _V_).
1. Perform ? _ObjRec_.InitializeBinding(_N_, _V_).
1. Return ~unused~.
</emu-alg>
</emu-clause>

Expand All @@ -10900,7 +10901,7 @@ <h1>
_N_: a String,
_V_: an ECMAScript language value,
_S_: a Boolean,
)
): a Completion Record normally containing ~unused~
</h1>
<dl class="header">
<dt>for</dt>
Expand All @@ -10914,7 +10915,8 @@ <h1>
1. If _DclRec_.HasBinding(_N_) is *true*, then
1. Return _DclRec_.SetMutableBinding(_N_, _V_, _S_).
1. Let _ObjRec_ be _envRec_.[[ObjectRecord]].
1. Return ? _ObjRec_.SetMutableBinding(_N_, _V_, _S_).
1. Perform ? _ObjRec_.SetMutableBinding(_N_, _V_, _S_).
1. Return ~unused~.
</emu-alg>
</emu-clause>

Expand All @@ -10923,7 +10925,7 @@ <h1>
GetBindingValue (
_N_: a String,
_S_: a Boolean,
)
): a Completion Record normally containing an ECMAScript language value
</h1>
<dl class="header">
<dt>for</dt>
Expand Down Expand Up @@ -10972,7 +10974,7 @@ <h1>
</emu-clause>

<emu-clause id="sec-global-environment-records-hasthisbinding" type="concrete method">
<h1>HasThisBinding ( )</h1>
<h1>HasThisBinding ( ): *true*</h1>
<dl class="header">
<dt>for</dt>
<dd>a global Environment Record _envRec_</dd>
Expand All @@ -10986,7 +10988,7 @@ <h1>HasThisBinding ( )</h1>
</emu-clause>

<emu-clause id="sec-global-environment-records-hassuperbinding" type="concrete method">
<h1>HasSuperBinding ( )</h1>
<h1>HasSuperBinding ( ): *false*</h1>
<dl class="header">
<dt>for</dt>
<dd>a global Environment Record _envRec_</dd>
Expand All @@ -11000,7 +11002,7 @@ <h1>HasSuperBinding ( )</h1>
</emu-clause>

<emu-clause id="sec-global-environment-records-withbaseobject" type="concrete method">
<h1>WithBaseObject ( )</h1>
<h1>WithBaseObject ( ) *undefined*</h1>
<dl class="header">
<dt>for</dt>
<dd>a global Environment Record _envRec_</dd>
Expand All @@ -11011,7 +11013,7 @@ <h1>WithBaseObject ( )</h1>
</emu-clause>

<emu-clause id="sec-global-environment-records-getthisbinding" type="concrete method">
<h1>GetThisBinding ( )</h1>
<h1>GetThisBinding ( ): an ECMAScript language value</h1>
<dl class="header">
<dt>for</dt>
<dd>a global Environment Record _envRec_</dd>
Expand All @@ -11025,7 +11027,7 @@ <h1>GetThisBinding ( )</h1>
<h1>
HasVarDeclaration (
_N_: a String,
)
): a Boolean
</h1>
<dl class="header">
<dt>for</dt>
Expand All @@ -11045,7 +11047,7 @@ <h1>
<h1>
HasLexicalDeclaration (
_N_: a String,
)
): a Boolean
</h1>
<dl class="header">
<dt>for</dt>
Expand All @@ -11064,7 +11066,7 @@ <h1>
<h1>
HasRestrictedGlobalProperty (
_N_: a String,
)
): a Completion Record normally containing a Boolean
</h1>
<dl class="header">
<dt>for</dt>
Expand All @@ -11090,7 +11092,7 @@ <h1>
<h1>
CanDeclareGlobalVar (
_N_: a String,
)
): a Completion Record normally containing a Boolean
</h1>
<dl class="header">
<dt>for</dt>
Expand All @@ -11112,7 +11114,7 @@ <h1>
<h1>
CanDeclareGlobalFunction (
_N_: a String,
)
): a Completion Record normally containing a Boolean
</h1>
<dl class="header">
<dt>for</dt>
Expand All @@ -11137,7 +11139,7 @@ <h1>
CreateGlobalVarBinding (
_N_: a String,
_D_: a Boolean,
)
): a Completion Record normally containing ~unused~
</h1>
<dl class="header">
<dt>for</dt>
Expand All @@ -11157,7 +11159,7 @@ <h1>
1. Let _varDeclaredNames_ be _envRec_.[[VarNames]].
1. If _varDeclaredNames_ does not contain _N_, then
1. Append _N_ to _varDeclaredNames_.
1. Return NormalCompletion(~empty~).
1. Return NormalCompletion(~unused~).
</emu-alg>
</emu-clause>

Expand All @@ -11167,7 +11169,7 @@ <h1>
_N_: a String,
_V_: an ECMAScript language value,
_D_: a Boolean,
)
) a Completion Record normally containing ~unused~
</h1>
<dl class="header">
<dt>for</dt>
Expand All @@ -11189,7 +11191,7 @@ <h1>
1. Let _varDeclaredNames_ be _envRec_.[[VarNames]].
1. If _varDeclaredNames_ does not contain _N_, then
1. Append _N_ to _varDeclaredNames_.
1. Return NormalCompletion(~empty~).
1. Return NormalCompletion(~unused~).
</emu-alg>
<emu-note>
<p>Global function declarations are always represented as own properties of the global object. If possible, an existing own property is reconfigured to have a standard set of attribute values. Step <emu-xref href="#step-createglobalfunctionbinding-set"></emu-xref> is equivalent to what calling the InitializeBinding concrete method would do and if _globalObject_ is a Proxy will produce the same sequence of Proxy trap calls.</p>
Expand Down Expand Up @@ -11238,7 +11240,7 @@ <h1>
GetBindingValue (
_N_: a String,
_S_: a Boolean,
)
): a Completion Record normally containing an ECMAScript language value
</h1>
<dl class="header">
<dt>for</dt>
Expand Down Expand Up @@ -11272,7 +11274,7 @@ <h1>DeleteBinding ( _N_ )</h1>
</emu-clause>

<emu-clause id="sec-module-environment-records-hasthisbinding" type="concrete method">
<h1>HasThisBinding ( )</h1>
<h1>HasThisBinding ( ): *true*</h1>
<dl class="header">
<dt>for</dt>
<dd>a module Environment Record _envRec_</dd>
Expand All @@ -11286,7 +11288,7 @@ <h1>HasThisBinding ( )</h1>
</emu-clause>

<emu-clause id="sec-module-environment-records-getthisbinding" type="concrete method">
<h1>GetThisBinding ( )</h1>
<h1>GetThisBinding ( ): *undefined*</h1>
<dl class="header">
<dt>for</dt>
<dd>a module Environment Record _envRec_</dd>
Expand All @@ -11302,7 +11304,7 @@ <h1>
_N_: a String,
_M_: a Module Record,
_N2_: a String,
)
): ~unused~
</h1>
<dl class="header">
<dt>for</dt>
Expand All @@ -11315,7 +11317,7 @@ <h1>
1. Assert: _envRec_ does not already have a binding for _N_.
1. Assert: When _M_.[[Environment]] is instantiated it will have a direct binding for _N2_.
1. Create an immutable indirect binding in _envRec_ for _N_ that references _M_ and _N2_ as its target binding and record that the binding is initialized.
1. Return NormalCompletion(~empty~).
1. Return ~unused~.
</emu-alg>
</emu-clause>
</emu-clause>
Expand All @@ -11331,16 +11333,16 @@ <h1>
_env_: an Environment Record or *null*,
_name_: a String,
_strict_: a Boolean,
)
): a Completion Record normally containing a Reference Record
</h1>
<dl class="header">
</dl>
<emu-alg>
1. If _env_ is the value *null*, then
1. Return the Reference Record { [[Base]]: ~unresolvable~, [[ReferencedName]]: _name_, [[Strict]]: _strict_, [[ThisValue]]: ~empty~ }.
1. Return NormalCompletion(the Reference Record { [[Base]]: ~unresolvable~, [[ReferencedName]]: _name_, [[Strict]]: _strict_, [[ThisValue]]: ~empty~ }).
1. Let _exists_ be ? _env_.HasBinding(_name_).
1. If _exists_ is *true*, then
1. Return the Reference Record { [[Base]]: _env_, [[ReferencedName]]: _name_, [[Strict]]: _strict_, [[ThisValue]]: ~empty~ }.
1. Return NormalCompletion(the Reference Record { [[Base]]: _env_, [[ReferencedName]]: _name_, [[Strict]]: _strict_, [[ThisValue]]: ~empty~ }).
1. Else,
1. Let _outer_ be _env_.[[OuterEnv]].
1. Return ? GetIdentifierReference(_outer_, _name_, _strict_).
Expand Down Expand Up @@ -14328,8 +14330,8 @@ <h1>
1. Let _map_ be _args_.[[ParameterMap]].
1. Let _isMapped_ be ! HasOwnProperty(_map_, _P_).
1. If _isMapped_ is *true*, then
1. Let _setStatus_ be Set(_map_, _P_, _V_, *false*).
1. Assert: _setStatus_ is *true* because formal parameters mapped by argument objects are always writable.
1. Assert: formal parameters mapped by argument objects are always writable.
1. Call Set(_map_, _P_, _V_, *false*).
1. Return ? OrdinarySet(_args_, _P_, _V_, _Receiver_).
</emu-alg>
</emu-clause>
Expand Down Expand Up @@ -27682,7 +27684,7 @@ <h1>InitializeEnvironment ( )</h1>
1. Perform ! _env_.CreateImmutableBinding(_in_.[[LocalName]], *true*).
1. Call _env_.InitializeBinding(_in_.[[LocalName]], _namespace_).
1. Else,
1. Call _env_.CreateImportBinding(_in_.[[LocalName]], _resolution_.[[Module]], _resolution_.[[BindingName]]).
1. Perform _env_.CreateImportBinding(_in_.[[LocalName]], _resolution_.[[Module]], _resolution_.[[BindingName]]).
1. Let _moduleContext_ be a new ECMAScript code execution context.
1. Set the Function of _moduleContext_ to *null*.
1. Assert: _module_.[[Realm]] is not *undefined*.
Expand Down

0 comments on commit 0cbd188

Please sign in to comment.