Skip to content

Commit

Permalink
if we do not consume the return value, return unused
Browse files Browse the repository at this point in the history
  • Loading branch information
bakkot authored and michaelficarra committed Feb 2, 2022
1 parent 2db2a06 commit 1897937
Showing 1 changed file with 22 additions and 20 deletions.
42 changes: 22 additions & 20 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -6285,15 +6285,16 @@ <h1>
_O_: an Object,
_P_: a property key,
_V_: an ECMAScript language value,
): a Completion Record normally containing a Boolean
): a Completion Record normally containing ~unused~
</h1>
<dl class="header">
<dt>description</dt>
<dd>It is used to create a new own property of an object.</dd>
</dl>
<emu-alg>
1. Let _newDesc_ be the PropertyDescriptor { [[Value]]: _V_, [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.
1. Return ? <emu-meta effects="user-code">_O_.[[DefineOwnProperty]]</emu-meta>(_P_, _newDesc_).
1. Perform ? <emu-meta effects="user-code">_O_.[[DefineOwnProperty]]</emu-meta>(_P_, _newDesc_).
1. Return NormalCompletion(~unused~).
</emu-alg>
<emu-note>
<p>This abstract operation creates a property whose attributes are set to the same defaults used for built-in methods and methods defined using class declaration syntax. Normally, the property will not already exist. If it does exist and is not configurable or if _O_ is not extensible, [[DefineOwnProperty]] will return *false*.</p>
Expand Down Expand Up @@ -6328,15 +6329,16 @@ <h1>
_O_: an Object,
_P_: a property key,
_V_: an ECMAScript language value,
): a Completion Record normally containing a Boolean
): a Completion Record normally containing ~unused~
</h1>
<dl class="header">
<dt>description</dt>
<dd>It is used to create a new non-enumerable own property of an object. It throws a *TypeError* exception if the requested property update cannot be performed.</dd>
</dl>
<emu-alg>
1. Let _newDesc_ be the PropertyDescriptor { [[Value]]: _V_, [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.
1. Return ? DefinePropertyOrThrow(_O_, _P_, _newDesc_).
1. Perform ? DefinePropertyOrThrow(_O_, _P_, _newDesc_).
1. Return NormalCompletion(~unused~).
</emu-alg>
<emu-note>
<p>This abstract operation creates a property whose attributes are set to the same defaults used for properties created by the ECMAScript language assignment operator except it is not enumerable. Normally, the property will not already exist. If it does exist and is not configurable or if _O_ is not extensible, [[DefineOwnProperty]] will return *false* causing this operation to throw a *TypeError* exception.</p>
Expand All @@ -6349,7 +6351,7 @@ <h1>
_O_: an Object,
_P_: a property key,
_desc_: a Property Descriptor,
): a Completion Record normally containing a Boolean
): a Completion Record normally containing ~unused~.
</h1>
<dl class="header">
<dt>description</dt>
Expand All @@ -6358,7 +6360,7 @@ <h1>
<emu-alg>
1. Let _success_ be ? <emu-meta effects="user-code">_O_.[[DefineOwnProperty]]</emu-meta>(_P_, _desc_).
1. If _success_ is *false*, throw a *TypeError* exception.
1. Return _success_.
1. Return NormalCompletion(~unused~).
</emu-alg>
</emu-clause>

Expand All @@ -6367,7 +6369,7 @@ <h1>
DeletePropertyOrThrow (
_O_: an Object,
_P_: a property key,
): a Completion Record normally containing a Boolean
): a Completion Record normally containing ~unused~
</h1>
<dl class="header">
<dt>description</dt>
Expand All @@ -6376,7 +6378,7 @@ <h1>
<emu-alg>
1. Let _success_ be ? <emu-meta effects="user-code">_O_.[[Delete]]</emu-meta>(_P_).
1. If _success_ is *false*, throw a *TypeError* exception.
1. Return _success_.
1. Return ~unused~.
</emu-alg>
</emu-clause>

Expand Down Expand Up @@ -10323,7 +10325,7 @@ <h1>
CreateMutableBinding (
_N_: a String,
_D_: a Boolean,
): a Completion Record
): a Completion Record normally containing ~unused~
</h1>
<dl class="header">
<dt>for</dt>
Expand All @@ -10334,7 +10336,8 @@ <h1>
</dl>
<emu-alg>
1. Let _bindingObject_ be _envRec_.[[BindingObject]].
1. Return ? DefinePropertyOrThrow(_bindingObject_, _N_, PropertyDescriptor { [[Value]]: *undefined*, [[Writable]]: *true*, [[Enumerable]]: *true*, [[Configurable]]: _D_ }).
1. Perform ? DefinePropertyOrThrow(_bindingObject_, _N_, PropertyDescriptor { [[Value]]: *undefined*, [[Writable]]: *true*, [[Enumerable]]: *true*, [[Configurable]]: _D_ }).
1. Return NormalCompletion(~unused~).
</emu-alg>
<emu-note>
<p>Normally _envRec_ will not have a binding for _N_ but if it does, the semantics of DefinePropertyOrThrow may result in an existing binding being replaced or shadowed or cause an abrupt completion to be returned.</p>
Expand Down Expand Up @@ -11601,16 +11604,15 @@ <h1>CreateRealm ( ): a Realm Record</h1>
<h1>
CreateIntrinsics (
_realmRec_: unknown,
): a Record
): ~unused~
</h1>
<dl class="header">
</dl>
<emu-alg>
1. Let _intrinsics_ be a new Record.
1. Set _realmRec_.[[Intrinsics]] to _intrinsics_.
1. Set fields of _intrinsics_ with the values listed in <emu-xref href="#table-well-known-intrinsic-objects"></emu-xref>. The field names are the names listed in column one of the table. The value of each field is a new object value fully and recursively populated with property values as defined by the specification of each object in clauses <emu-xref href="#sec-global-object"></emu-xref> through <emu-xref href="#sec-reflection"></emu-xref>. All object property values are newly created object values. All values that are built-in function objects are created by performing CreateBuiltinFunction(_steps_, _length_, _name_, _slots_, _realmRec_, _prototype_) where _steps_ is the definition of that function provided by this specification, _name_ is the initial value of the function's `name` property, _length_ is the initial value of the function's `length` property, _slots_ is a list of the names, if any, of the function's specified internal slots, and _prototype_ is the specified value of the function's [[Prototype]] internal slot. The creation of the intrinsics and their properties must be ordered to avoid any dependencies upon objects that have not yet been created.
1. Perform AddRestrictedFunctionProperties(_intrinsics_.[[%Function.prototype%]], _realmRec_).
1. Return _intrinsics_.
1. Set _realmRec_.[[Intrinsics]] to a new Record.
1. Set fields of _realmRec_.[[Intrinsics]] with the values listed in <emu-xref href="#table-well-known-intrinsic-objects"></emu-xref>. The field names are the names listed in column one of the table. The value of each field is a new object value fully and recursively populated with property values as defined by the specification of each object in clauses <emu-xref href="#sec-global-object"></emu-xref> through <emu-xref href="#sec-reflection"></emu-xref>. All object property values are newly created object values. All values that are built-in function objects are created by performing CreateBuiltinFunction(_steps_, _length_, _name_, _slots_, _realmRec_, _prototype_) where _steps_ is the definition of that function provided by this specification, _name_ is the initial value of the function's `name` property, _length_ is the initial value of the function's `length` property, _slots_ is a list of the names, if any, of the function's specified internal slots, and _prototype_ is the specified value of the function's [[Prototype]] internal slot. The creation of the intrinsics and their properties must be ordered to avoid any dependencies upon objects that have not yet been created.
1. Perform AddRestrictedFunctionProperties(_realmRec_.[[Intrinsics]].[[%Function.prototype%]], _realmRec_).
1. Return ~unused~.
</emu-alg>
</emu-clause>

Expand Down Expand Up @@ -28692,8 +28694,8 @@ <h1>
1. Else,
1. Let _bindingExists_ be _varEnv_.HasBinding(_fn_).
1. If _bindingExists_ is *false*, then
1. Let _status_ be ! _varEnv_.CreateMutableBinding(_fn_, *true*).
1. Assert: _status_ is not an abrupt completion because of validation preceding step <emu-xref href="#step-evaldeclarationinstantiation-post-validation"></emu-xref>.
1. NOTE: The following invocation cannot return an abrupt completion because of the validation preceding step <emu-xref href="#step-evaldeclarationinstantiation-post-validation"></emu-xref>.
1. Perform ! _varEnv_.CreateMutableBinding(_fn_, *true*).
1. Perform ! _varEnv_.InitializeBinding(_fn_, _fo_).
1. Else,
1. Perform ! _varEnv_.SetMutableBinding(_fn_, _fo_, *false*).
Expand All @@ -28703,8 +28705,8 @@ <h1>
1. Else,
1. Let _bindingExists_ be _varEnv_.HasBinding(_vn_).
1. If _bindingExists_ is *false*, then
1. Let _status_ be ! _varEnv_.CreateMutableBinding(_vn_, *true*).
1. Assert: _status_ is not an abrupt completion because of validation preceding step <emu-xref href="#step-evaldeclarationinstantiation-post-validation"></emu-xref>.
1. NOTE: The following invocation cannot return an abrupt completion because of the validation preceding step <emu-xref href="#step-evaldeclarationinstantiation-post-validation"></emu-xref>.
1. Perform ! _varEnv_.CreateMutableBinding(_vn_, *true*).
1. Perform ! _varEnv_.InitializeBinding(_vn_, *undefined*).
1. Return NormalCompletion(~unused~).
</emu-alg>
Expand Down

0 comments on commit 1897937

Please sign in to comment.