tc39 / proposal-intl-duration-format

https://tc39.es/proposal-intl-duration-format
MIT License
163 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 3 months ago

ben-allen commented 6 months ago

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

ben-allen commented 6 months ago

Supersedes #186

sffc commented 6 months ago

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

ben-allen commented 6 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 4 months ago

Requesting re-review! @FrankYFTang @ryzokuken

ben-allen commented 4 months ago

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

ben-allen commented 4 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 4 months ago

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