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

Normative: Correctly respect largestUnit option in duration rounding #2571

Merged
merged 2 commits into from
Nov 14, 2023

Commits on Nov 14, 2023

  1. Normative: Balance durations after rounding in until()/since()/toStri…

    …ng()
    
    In cases where a number rounded up to the next unit, we would previously
    return a result that didn't respect the `largestUnit` option in the same
    way that Duration.prototype.round() would.
    
    To fix this, we need to call BalanceDateDurationRelative after
    RoundDuration in the until()/since() methods that deal with date units
    (time units already behaved correctly).
    
    In Duration.prototype.toString() where time units did not already behave
    correctly, we need to call BalanceTimeDuration. I was not sure whether it
    was intentional that we didn't call this, but as far as I can determine
    from the previous discussions, `toString()` was "controls rounding, works
    same as `round()`", but the status quo was that it worked differently from
    `round()`.)
    
    Closes: #2563
    ptomato committed Nov 14, 2023
    Configuration menu
    Copy the full SHA
    17bf415 View commit details
    Browse the repository at this point in the history
  2. Update test262

    ptomato committed Nov 14, 2023
    Configuration menu
    Copy the full SHA
    652788d View commit details
    Browse the repository at this point in the history