Conversation
Fixes tc39#609. Removes non-`Duration` use of `{disambiguation: 'balance'}` from polyfill, because all known use-cases are better served by using `plus()` instead. Note that balancing _behavior_ is still present, because it's needed for `plus` and `minus`. it's just the `balance` disambiguation option for `with` and `from` that's being removed for non-Duration types. `Duration` still retains this option, because (unlike other types), there's a need to create and persist unbalanced `Duration` instances. Now, non-Duration arithmetic options have the same disambiguation options as `from` and `with`. Abstract operations were renamed accordingly.
Converts the cookbook's single non-Duration use of
`{disambiguation: 'balance'}` to use `plus` instead.
b1760b6 to
eab70dd
Compare
Collaborator
Author
|
Fixed merge conflicts and force-pushed. |
Codecov Report
@@ Coverage Diff @@
## main #642 +/- ##
==========================================
- Coverage 96.15% 96.11% -0.04%
==========================================
Files 17 17
Lines 4027 3988 -39
Branches 650 645 -5
==========================================
- Hits 3872 3833 -39
Misses 153 153
Partials 2 2
Continue to review full report at Codecov.
|
Fixes tc39#609. Removes non-`Duration` use of `{disambiguation: 'balance'}` from spec, because all known use-cases are better served by using `plus()` instead. Note that balancing _behavior_ is still present, because it's needed for `plus` and `minus`. it's just the `balance` disambiguation option for `with` and `from` that's being removed for non-Duration types. `Duration` still retains this option, because (unlike other types), there's a need to create and persist unbalanced `Duration` instances. Now, non-Duration arithmetic options have the same disambiguation options as `from` and `with`. Abstract operations were renamed accordingly.
eab70dd to
11d5f3b
Compare
ptomato
approved these changes
Jun 3, 2020
Collaborator
ptomato
left a comment
There was a problem hiding this comment.
With one small change, I think this is OK. Might be good to see if anyone else weighs in since we've only heard from me and @pipobscure
Collaborator
|
I have no strong opinion on this and am happy to defer to the other champions. |
ryzokuken
approved these changes
Jun 3, 2020
Member
ryzokuken
left a comment
There was a problem hiding this comment.
LGTM, thanks. Just a few comments.
Co-authored-by: Ujjwal Sharma <ryzokuken@disroot.org>
16 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #609. Removes use of
{disambiguation: 'balance'}in non-Durationclasses'withandfrommethods, because all known use cases are better served by usingplus()instead. Usage is removed from docs, cookbook, polyfill, tests, TS types, and spec.Note that balancing behavior is still present, because it's needed for
plusandminus. it's just thebalancedisambiguation option forwithandfromthat's being removed for non-Durationtypes, because instead of shoehorning math operations intowithorfrom, we want to guide developers to use real math operations likeplusorminus.Durationstill retains this option for itswithandfrombecauseDuration(unlike other types) can create and persist unbalancedDurationinstances, so there needs to be some way to create a balanced clone of an existing duration.With this PR, non-Duration arithmetic options now have the same disambiguation options as
fromandwith. Abstract operations were renamed accordingly:ToTemporalDisambiguationwithbalanceis now used only inDuration, so it's renamed toToDurationTemporalDisambiguationToArithmeticTemporalDisambiguationnow matches the samedisambiguationoptions as are used by non-Durationwithandfrommethods, so it's been renamed toToTemporalDisambiguationand this combined abstract operation it's now used for all types'plusandminusas well as non-Durationwithandfrom.