Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editorial: Removed several unnecessary double negatives #796

Merged
merged 2 commits into from
Mar 1, 2024

Conversation

ben-allen
Copy link
Contributor

@ben-allen ben-allen commented Jun 26, 2023

Rebased 3-1-24, and updated to include @gibson042 suggestion to improve readability of SetNumberFormatDigitOptions AO in Intl.NumberFormat
Fix #458

Refactored several cases from

  1. If not undefined, then
    a. X
    2 Else,
    a. Y

with

  1. If undefined, then
    a. Y
  2. Else,
    a. X

and

  1. If not undefined, then
    a. Return X.
  2. Return Y.

to

  1. If undefined, then
    a. Return Y.
  2. Return X.

@ryzokuken ryzokuken requested a review from gibson042 June 28, 2023 10:06
@ryzokuken ryzokuken added editorial Involves an editorial fix needs review labels Jun 29, 2023
Comment on lines 126 to 133
1. If _mnsd_ is not *undefined* or _mxsd_ is not *undefined*, then
1. Let _hasSd_ be *true*.
1. Else,
1. If _mnsd_ is *undefined* and _mxsd_ is *undefined*, then
1. Let _hasSd_ be *false*.
1. If _mnfd_ is not *undefined* or _mxfd_ is not *undefined*, then
1. Let _hasFd_ be *true*.
1. Else,
1. Let _hasSd_ be *true*.
1. If _mnfd_ is *undefined* and _mxfd_ is *undefined*, then
1. Let _hasFd_ be *false*.
1. Else,
1. Let _hasFd be *true*.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This still strikes me as hard to read. Maybe consolidating the alternatives would help?

Suggested change
1. If _mnsd_ is not *undefined* or _mxsd_ is not *undefined*, then
1. Let _hasSd_ be *true*.
1. Else,
1. If _mnsd_ is *undefined* and _mxsd_ is *undefined*, then
1. Let _hasSd_ be *false*.
1. If _mnfd_ is not *undefined* or _mxfd_ is not *undefined*, then
1. Let _hasFd_ be *true*.
1. Else,
1. Let _hasSd_ be *true*.
1. If _mnfd_ is *undefined* and _mxfd_ is *undefined*, then
1. Let _hasFd_ be *false*.
1. Else,
1. Let _hasFd be *true*.
1. If _mnsd_ is *undefined* and _mxsd_ is *undefined*, let _hasSd_ be *false*. Otherwise, let _hasSd_ be *true*.
1. If _mnfd_ is *undefined* and _mxfd_ is *undefined*, let _hasFd_ be *false*. Otherwise, let _hasFd be *true*.

spec/datetimeformat.html Outdated Show resolved Hide resolved
spec/datetimeformat.html Outdated Show resolved Hide resolved
spec/datetimeformat.html Show resolved Hide resolved
@sffc sffc self-requested a review August 23, 2023 22:58
Copy link
Contributor

@sffc sffc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fairly neutral on this; smaller changes are better.

@ben-allen ben-allen requested a review from gibson042 March 1, 2024 21:01
@gibson042 gibson042 merged commit 053a606 into tc39:main Mar 1, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
editorial Involves an editorial fix needs review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Editorial: If x is not undefined, then A / Else B
4 participants