Skip to content

Commit

Permalink
Editorial: Simplify IsFooDescriptor ops (#2624)
Browse files Browse the repository at this point in the history
i.e., IsAccessorDescriptor, IsDataDescriptor, IsGenericDescriptor

- Prefer "has a field" over "does not have a field".
- Prefer simple conditions over conjunctions.
  • Loading branch information
jmdyck authored and ljharb committed Feb 16, 2022
1 parent b3c29fd commit 1c7ae4b
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -4290,8 +4290,9 @@ <h1>
</dl>
<emu-alg>
1. If _Desc_ is *undefined*, return *false*.
1. If _Desc_ does not have a [[Get]] field and _Desc_ does not have a [[Set]] field, return *false*.
1. Return *true*.
1. If _Desc_ has a [[Get]] field, return *true*.
1. If _Desc_ has a [[Set]] field, return *true*.
1. Return *false*.
</emu-alg>
</emu-clause>

Expand All @@ -4305,8 +4306,9 @@ <h1>
</dl>
<emu-alg>
1. If _Desc_ is *undefined*, return *false*.
1. If _Desc_ does not have a [[Value]] field and _Desc_ does not have a [[Writable]] field, return *false*.
1. Return *true*.
1. If _Desc_ has a [[Value]] field, return *true*.
1. If _Desc_ has a [[Writable]] field, return *true*.
1. Return *false*.
</emu-alg>
</emu-clause>

Expand All @@ -4320,8 +4322,9 @@ <h1>
</dl>
<emu-alg>
1. If _Desc_ is *undefined*, return *false*.
1. If IsAccessorDescriptor(_Desc_) and IsDataDescriptor(_Desc_) are both *false*, return *true*.
1. Return *false*.
1. If IsAccessorDescriptor(_Desc_) is *true*, return *false*.
1. If IsDataDescriptor(_Desc_) is *true*, return *false*.
1. Return *true*.
</emu-alg>
</emu-clause>

Expand Down

0 comments on commit 1c7ae4b

Please sign in to comment.