Skip to content

Commit

Permalink
Editorial: Fix bug with RelativeTimeFormat and DateTimeFormat not cor…
Browse files Browse the repository at this point in the history
…rectly passing "numberingSystem" option to NumberFormat

"numberingSystem" previously ignored, now correctly used
  • Loading branch information
ben-allen authored Oct 11, 2024
1 parent 62fe5db commit 7508197
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions spec/datetimeformat.html
Original file line number Diff line number Diff line change
Expand Up @@ -1404,16 +1404,19 @@ <h1>
<emu-alg>
1. Let _locale_ be _dateTimeFormat_.[[Locale]].
1. Let _nfOptions_ be OrdinaryObjectCreate(*null*).
1. Perform ! CreateDataPropertyOrThrow(_nfOptions_, *"numberingSystem"*, _dateTimeFormat_.[[NumberingSystem]]).
1. Perform ! CreateDataPropertyOrThrow(_nfOptions_, *"useGrouping"*, *false*).
1. Let _nf_ be ! Construct(%Intl.NumberFormat%, « _locale_, _nfOptions_ »).
1. Let _nf2Options_ be OrdinaryObjectCreate(*null*).
1. Perform ! CreateDataPropertyOrThrow(_nf2Options_, *"minimumIntegerDigits"*, *2*<sub>𝔽</sub>).
1. Perform ! CreateDataPropertyOrThrow(_nf2Options_, *"numberingSystem"*, _dateTimeFormat_.[[NumberingSystem]]).
1. Perform ! CreateDataPropertyOrThrow(_nf2Options_, *"useGrouping"*, *false*).
1. Let _nf2_ be ! Construct(%Intl.NumberFormat%, « _locale_, _nf2Options_ »).
1. If _format_ has a field [[fractionalSecondDigits]], then
1. Let _fractionalSecondDigits_ be _format_.[[fractionalSecondDigits]].
1. Let _nf3Options_ be OrdinaryObjectCreate(*null*).
1. Perform ! CreateDataPropertyOrThrow(_nf3Options_, *"minimumIntegerDigits"*, 𝔽(_fractionalSecondDigits_)).
1. Perform ! CreateDataPropertyOrThrow(_nf3Options_, *"numberingSystem"*, _dateTimeFormat_.[[NumberingSystem]]).
1. Perform ! CreateDataPropertyOrThrow(_nf3Options_, *"useGrouping"*, *false*).
1. Let _nf3_ be ! Construct(%Intl.NumberFormat%, « _locale_, _nf3Options_ »).
1. Let _tm_ be ToLocalTime(_epochNanoseconds_, _dateTimeFormat_.[[Calendar]], _dateTimeFormat_.[[TimeZone]]).
Expand Down
4 changes: 3 additions & 1 deletion spec/relativetimeformat.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ <h1>Intl.RelativeTimeFormat ( [ _locales_ [ , _options_ ] ] )</h1>
1. Set _relativeTimeFormat_.[[Style]] to _style_.
1. Let _numeric_ be ? GetOption(_options_, *"numeric"*, ~string~, « *"always"*, *"auto"* », *"always"*).
1. Set _relativeTimeFormat_.[[Numeric]] to _numeric_.
1. Let _relativeTimeFormat_.[[NumberFormat]] be ! Construct(%Intl.NumberFormat%, « _locale_ »).
1. Let _nfOptions_ be OrdinaryObjectCreate(*null*).
1. Perform ! CreateDataPropertyOrThrow(_nfOptions_, *"numberingSystem"*, _relativeTimeFormat_.[[NumberingSystem]]).
1. Let _relativeTimeFormat_.[[NumberFormat]] be ! Construct(%Intl.NumberFormat%, « _locale_, _nfOptions_ »).
1. Let _relativeTimeFormat_.[[PluralRules]] be ! Construct(%Intl.PluralRules%, « _locale_ »).
1. Return _relativeTimeFormat_.
</emu-alg>
Expand Down

0 comments on commit 7508197

Please sign in to comment.