Skip to content

Commit 053a606

Browse files
authored
Editorial: Remove unnecessary double negatives (#796)
1 parent 9d9be77 commit 053a606

File tree

2 files changed

+12
-18
lines changed

2 files changed

+12
-18
lines changed

spec/datetimeformat.html

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -130,16 +130,7 @@ <h1>
130130
1. Set _dateTimeFormat_.[[DateStyle]] to _dateStyle_.
131131
1. Let _timeStyle_ be ? GetOption(_options_, *"timeStyle"*, ~string~, &laquo; *"full"*, *"long"*, *"medium"*, *"short"* &raquo;, *undefined*).
132132
1. Set _dateTimeFormat_.[[TimeStyle]] to _timeStyle_.
133-
1. If _dateStyle_ is not *undefined* or _timeStyle_ is not *undefined*, then
134-
1. If _hasExplicitFormatComponents_ is *true*, then
135-
1. Throw a *TypeError* exception.
136-
1. If _required_ is ~date~ and _timeStyle_ is not *undefined*, then
137-
1. Throw a *TypeError* exception.
138-
1. If _required_ is ~time~ and _dateStyle_ is not *undefined*, then
139-
1. Throw a *TypeError* exception.
140-
1. Let _styles_ be _resolvedLocaleData_.[[styles]].[[&lt;_resolvedCalendar_&gt;]].
141-
1. Let _bestFormat_ be DateTimeStyleFormat(_dateStyle_, _timeStyle_, _styles_).
142-
1. Else,
133+
1. If _dateStyle_ is *undefined* and _timeStyle_ is *undefined*, then
143134
1. Let _needDefaults_ be *true*.
144135
1. If _required_ is ~date~ or ~any~, then
145136
1. For each property name _prop_ of &laquo; *"weekday"*, *"year"*, *"month"*, *"day"* &raquo;, do
@@ -160,6 +151,15 @@ <h1>
160151
1. Let _bestFormat_ be BasicFormatMatcher(_formatOptions_, _formats_).
161152
1. Else,
162153
1. Let _bestFormat_ be BestFitFormatMatcher(_formatOptions_, _formats_).
154+
1. Else,
155+
1. If _hasExplicitFormatComponents_ is *true*, then
156+
1. Throw a *TypeError* exception.
157+
1. If _required_ is ~date~ and _timeStyle_ is not *undefined*, then
158+
1. Throw a *TypeError* exception.
159+
1. If _required_ is ~time~ and _dateStyle_ is not *undefined*, then
160+
1. Throw a *TypeError* exception.
161+
1. Let _styles_ be _resolvedLocaleData_.[[styles]].[[&lt;_resolvedCalendar_&gt;]].
162+
1. Let _bestFormat_ be DateTimeStyleFormat(_dateStyle_, _timeStyle_, _styles_).
163163
1. For each row of <emu-xref href="#table-datetimeformat-components"></emu-xref>, except the header row, in table order, do
164164
1. Let _prop_ be the name given in the Property column of the current row.
165165
1. If _bestFormat_ has a field [[&lt;_prop_&gt;]], then

spec/numberformat.html

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -135,14 +135,8 @@ <h1>
135135
1. Set _intlObj_.[[RoundingIncrement]] to _roundingIncrement_.
136136
1. Set _intlObj_.[[RoundingMode]] to _roundingMode_.
137137
1. Set _intlObj_.[[TrailingZeroDisplay]] to _trailingZeroDisplay_.
138-
1. If _mnsd_ is not *undefined* or _mxsd_ is not *undefined*, then
139-
1. Let _hasSd_ be *true*.
140-
1. Else,
141-
1. Let _hasSd_ be *false*.
142-
1. If _mnfd_ is not *undefined* or _mxfd_ is not *undefined*, then
143-
1. Let _hasFd_ be *true*.
144-
1. Else,
145-
1. Let _hasFd_ be *false*.
138+
1. If _mnsd_ is *undefined* and _mxsd_ is *undefined*, let _hasSd_ be *false*. Otherwise, let _hasSd_ be *true*.
139+
1. If _mnfd_ is *undefined* and _mxsd_ is *undefined*, let _hasFd_ be *false*. Otherwise, let _hasFd_ be *true*.
146140
1. Let _needSd_ be *true*.
147141
1. Let _needFd_ be *true*.
148142
1. If _roundingPriority_ is *"auto"*, then

0 commit comments

Comments
 (0)