Skip to content

Commit

Permalink
Editorial: OrdinaryDefineOwnProperty can't throw for ordinary objects…
Browse files Browse the repository at this point in the history
… and arrays

`OrdinaryDefineOwnProperty` can return an abrupt completion if either
`O.[[GetOwnProperty]]` or `IsExtensible(O)` returns an abrupt completion. When
`O` is an ordinary object or an array, neither `O.[[GetOwnProperty]]` nor
`IsExtensible(O)` can return an abrupt completion, therefore
`OrdinaryDefineOwnProperty` is infallible.
  • Loading branch information
anba committed Aug 26, 2024
1 parent 6c621d2 commit 72e160c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -12671,14 +12671,14 @@ <h1>
[[DefineOwnProperty]] (
_P_: a property key,
_Desc_: a Property Descriptor,
): either a normal completion containing a Boolean or a throw completion
): a Boolean
</h1>
<dl class="header">
<dt>for</dt>
<dd>an ordinary object _O_</dd>
</dl>
<emu-alg>
1. Return ? OrdinaryDefineOwnProperty(_O_, _P_, _Desc_).
1. Return ! OrdinaryDefineOwnProperty(_O_, _P_, _Desc_).
</emu-alg>

<emu-clause id="sec-ordinarydefineownproperty" type="abstract operation">
Expand All @@ -12690,6 +12690,8 @@ <h1>
): either a normal completion containing a Boolean or a throw completion
</h1>
<dl class="header">
<dt>skip global checks</dt>
<dd>true</dd>
</dl>
<emu-alg>
1. Let _current_ be ? <emu-meta effects="user-code">_O_.[[GetOwnProperty]]</emu-meta>(_P_).
Expand Down Expand Up @@ -14092,7 +14094,7 @@ <h1>
1. Set _succeeded_ to ! OrdinaryDefineOwnProperty(_A_, *"length"*, _lengthDesc_).
1. Assert: _succeeded_ is *true*.
1. Return *true*.
1. Return ? OrdinaryDefineOwnProperty(_A_, _P_, _Desc_).
1. Return ! OrdinaryDefineOwnProperty(_A_, _P_, _Desc_).
</emu-alg>
</emu-clause>

Expand Down

0 comments on commit 72e160c

Please sign in to comment.