tc39 / proposal-intl-duration-format

https://tc39.es/proposal-intl-duration-format
MIT License
171 stars 18 forks source link

Editorial: Refactor handling of numeric-like styles, support differing hours/minutes vs minutes/seconds separators #188

Closed ben-allen closed 6 months ago

ben-allen commented 9 months ago

Fixes https://github.com/tc39/proposal-intl-duration-format/issues/161

ben-allen commented 9 months ago

Supersedes #186

sffc commented 9 months ago

TG2 discussion: https://github.com/tc39/ecma402/blob/main/meetings/notes-2024-02-22.md#durationformat-update

ben-allen commented 8 months ago

Incorporated feedback, made a few additional changes:

Justification for removing SetFractionalDigitOptions: Talked it over with @ptomato, who observed that it could be confusing to add nfOpts properties in multiple AOs due to how setting properties can trigger setters in user code. Options as I see it:

  1. Leave as in this version of PR, with the steps for setting fractional digit options repeated in two places.
  2. Restore SetFractionalDigitOptions, since we're passing *null* to OrdinaryObjectCreate when creating nfOpts objects and so, if I understand it correctly, the poisoned object problem won't actually occur. However: creating properties on objects across multiple AOs is not currently something that happens in either 402 or Temporal
  3. Rewrite SetFractionalDigitOptions to return a Record which is then used by the caller to create nfOpts properties. Note: this doesn't actually save that many repeated steps.

requesting re-review! @ryzokuken @FrankYFTang

ben-allen commented 7 months ago

Requesting re-review! @FrankYFTang @ryzokuken

ben-allen commented 7 months ago

I've pushed a major update reflecting feedback from @ryzokuken and incorporating some additional bugfixes.

ben-allen commented 7 months ago

New revision ready for review! Much more solid thanks to @ryzokuken's feedback, but could still use more eyes. @gibson042 @FrankYFTang @sffc @anba

sffc commented 6 months ago

TG2 notes: https://github.com/tc39/ecma402/blob/main/meetings/notes-2024-04-25.md#durationformat-update