Skip to content

Commit

Permalink
Editorial: Simplify IsFooDescriptor ops
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 committed Jan 20, 2022
1 parent 4a29fe4 commit 45bb26f
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 @@ -4289,8 +4289,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 @@ -4304,8 +4305,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 @@ -4319,8 +4321,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 45bb26f

Please sign in to comment.