Skip to content

Commit 7508197

Browse files
authored
Editorial: Fix bug with RelativeTimeFormat and DateTimeFormat not correctly passing "numberingSystem" option to NumberFormat
"numberingSystem" previously ignored, now correctly used
1 parent 62fe5db commit 7508197

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

spec/datetimeformat.html

+3
Original file line numberDiff line numberDiff line change
@@ -1404,16 +1404,19 @@ <h1>
14041404
<emu-alg>
14051405
1. Let _locale_ be _dateTimeFormat_.[[Locale]].
14061406
1. Let _nfOptions_ be OrdinaryObjectCreate(*null*).
1407+
1. Perform ! CreateDataPropertyOrThrow(_nfOptions_, *"numberingSystem"*, _dateTimeFormat_.[[NumberingSystem]]).
14071408
1. Perform ! CreateDataPropertyOrThrow(_nfOptions_, *"useGrouping"*, *false*).
14081409
1. Let _nf_ be ! Construct(%Intl.NumberFormat%, « _locale_, _nfOptions_ »).
14091410
1. Let _nf2Options_ be OrdinaryObjectCreate(*null*).
14101411
1. Perform ! CreateDataPropertyOrThrow(_nf2Options_, *"minimumIntegerDigits"*, *2*<sub>𝔽</sub>).
1412+
1. Perform ! CreateDataPropertyOrThrow(_nf2Options_, *"numberingSystem"*, _dateTimeFormat_.[[NumberingSystem]]).
14111413
1. Perform ! CreateDataPropertyOrThrow(_nf2Options_, *"useGrouping"*, *false*).
14121414
1. Let _nf2_ be ! Construct(%Intl.NumberFormat%, « _locale_, _nf2Options_ »).
14131415
1. If _format_ has a field [[fractionalSecondDigits]], then
14141416
1. Let _fractionalSecondDigits_ be _format_.[[fractionalSecondDigits]].
14151417
1. Let _nf3Options_ be OrdinaryObjectCreate(*null*).
14161418
1. Perform ! CreateDataPropertyOrThrow(_nf3Options_, *"minimumIntegerDigits"*, 𝔽(_fractionalSecondDigits_)).
1419+
1. Perform ! CreateDataPropertyOrThrow(_nf3Options_, *"numberingSystem"*, _dateTimeFormat_.[[NumberingSystem]]).
14171420
1. Perform ! CreateDataPropertyOrThrow(_nf3Options_, *"useGrouping"*, *false*).
14181421
1. Let _nf3_ be ! Construct(%Intl.NumberFormat%, « _locale_, _nf3Options_ »).
14191422
1. Let _tm_ be ToLocalTime(_epochNanoseconds_, _dateTimeFormat_.[[Calendar]], _dateTimeFormat_.[[TimeZone]]).

spec/relativetimeformat.html

+3-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ <h1>Intl.RelativeTimeFormat ( [ _locales_ [ , _options_ ] ] )</h1>
3636
1. Set _relativeTimeFormat_.[[Style]] to _style_.
3737
1. Let _numeric_ be ? GetOption(_options_, *"numeric"*, ~string~, « *"always"*, *"auto"* », *"always"*).
3838
1. Set _relativeTimeFormat_.[[Numeric]] to _numeric_.
39-
1. Let _relativeTimeFormat_.[[NumberFormat]] be ! Construct(%Intl.NumberFormat%, « _locale_ »).
39+
1. Let _nfOptions_ be OrdinaryObjectCreate(*null*).
40+
1. Perform ! CreateDataPropertyOrThrow(_nfOptions_, *"numberingSystem"*, _relativeTimeFormat_.[[NumberingSystem]]).
41+
1. Let _relativeTimeFormat_.[[NumberFormat]] be ! Construct(%Intl.NumberFormat%, « _locale_, _nfOptions_ »).
4042
1. Let _relativeTimeFormat_.[[PluralRules]] be ! Construct(%Intl.PluralRules%, « _locale_ »).
4143
1. Return _relativeTimeFormat_.
4244
</emu-alg>

0 commit comments

Comments
 (0)