-
Notifications
You must be signed in to change notification settings - Fork 17
Various fixes #107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Various fixes #107
Changes from 3 commits
43b1115
913a65c
c7b5ac8
ce0a0d3
03cff7c
6e7153d
8f995d2
fdc27d6
7968d7c
2318b2f
1d54ece
1297f00
6692e97
e1a7fec
0c95440
cf89536
2fb3173
7d0c057
a8681d3
5789f68
1f87460
8eb0100
dfa1ce7
a90d077
7fe6e79
8f0890b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -269,10 +269,9 @@ contributors: Ujjwal Sharma, Younies Mahmoud | |
| 1. Let _style_ be the current value of the _styleSlot_ slot of _durationFormat_. | ||
| 1. Let _nextStyle_ be the current value of the _nextStyleSlot_ slot of _durationFormat_. | ||
| 1. Let _nfOpts_ be ! OrdinaryObjectCreate(`null`). | ||
| 1. Let _value_ be 0. | ||
| 1. Let _done_ be *false*. | ||
| 1. If _unit_ is `"seconds"`, `"milliseconds"` or `"microseconds"` and _nextStyle_ is `"numeric"`, then | ||
| 1. Set _value_ to _duration_.[[Microseconds]] + _duration_.[[Nanoseconds]] / 1000. | ||
| 1. Let _value_ be _duration_.[[Microseconds]] + _duration_.[[Nanoseconds]] / 1000. | ||
| 1. If _unit_ is `"seconds"` or `"milliseconds"`, then | ||
| 1. Set _value_ to _duration_.[[Milliseconds]] + _value_ / 1000. | ||
| 1. If _unit_ is `"seconds"`, then | ||
|
|
@@ -281,13 +280,13 @@ contributors: Ujjwal Sharma, Younies Mahmoud | |
| 1. Perform ! CreateDataPropertyOrThrow(_nfOpts_, `"minimumFractionDigits"`, _durationFormat_.[[FractionalDigits]]). | ||
| 1. Set _done_ to *true*. | ||
| 1. Else, | ||
| 1. Set _value_ to the current value of the _valueSlot_ slot of _duration_. | ||
| 1. Let _value_ be the current value of the _valueSlot_ slot of _duration_. | ||
| 1. If _style_ is `"2-digit"`, then | ||
| 1. Perform ! CreateDataPropertyOrThrow(_nfOpts_, `"minimumIntegerDigits"`, `2`). | ||
| 1. If _value_ is *+0*<sub>𝔽</sub> or *-0*<sub>𝔽</sub> and _display_ is `"auto"`, then | ||
| 1. If _value_ is 0 and _display_ is `"auto"`, then | ||
| 1. Skip to the next iteration. | ||
| 1. Let _nf_ be ? Construct(%NumberFormat%, « _durationFormat_.[[Locale]], _nfOpts_ »). | ||
| 1. Let _num_ be ! FormatNumeric(_durationFormat_.[[NumberFormat]], _value_). | ||
| 1. Let _num_ be ! FormatNumeric(_durationFormat_.[[NumberFormat]], 𝔽(_value_)). | ||
|
||
| 1. Let _dataLocale_ be _durationFormat_.[[DataLocale]]. | ||
| 1. Let _dataLocaleData_ be the current value of the _dataLocale_ slot of %DurationFormat%.[[LocaleData]]. | ||
| 1. If _style_ is `"2-digit"` or `"numeric"`, then | ||
|
|
@@ -297,7 +296,7 @@ contributors: Ujjwal Sharma, Younies Mahmoud | |
| 1. Append the new Record { [[Type]]: `"literal"`, [[Value]]: _separator_} to the end of _result_. | ||
| 1. Else, | ||
| 1. Let _pr_ be ? Construct(%PluralRules%, « _durationFormat_.[[Locale]] »). | ||
| 1. Let _prv_ be ! ResolvePlural(_pr_, _value_). | ||
| 1. Let _prv_ be ! ResolvePlural(_pr_, 𝔽(_value_)). | ||
| 1. Let _template_ be the current value of the _prv_ slot of the _unit_ slot of the _style_ slot of _dataLocaleData_.[[formats]]. | ||
| 1. Let _parts_ be ! MakePartsList(_template_, _unit_, _num_). | ||
| 1. Let _concat_ be an empty String. | ||
|
|
@@ -332,7 +331,8 @@ contributors: Ujjwal Sharma, Younies Mahmoud | |
| 1. Let _options_ be ? GetOptionsObject(_options_). | ||
| 1. Let _matcher_ be ? GetOption(_options_, `"localeMatcher"`, `"string"`, « `"lookup"`, `"best fit"` », `"best fit"`). | ||
| 1. Let _numberingSystem_ be ? GetOption(_options_, `"numberingSystem"`, `"string"`, *undefined*, *undefined*). | ||
| 1. If _numberingSystem_ does not match the Unicode Locale Identifier `type` nonterminal, throw a `RangeError` exception. | ||
| 1. If _numberingSystem_ is not *undefined, then | ||
| 1. If _numberingSystem_ does not match the Unicode Locale Identifier `type` nonterminal, throw a `RangeError` exception. | ||
| 1. Let _opt_ be the Record { [[localeMatcher]]: _matcher_, [[nu]]: _numberingSystem_ }. | ||
| 1. Let _r_ be ResolveLocale(%DurationFormat%.[[AvailableLocales]], _requestedLocales_, _opt_, %DurationFormat%.[[RelevantExtensionKeys]], %DurationFormat%.[[LocaleData]]). | ||
| 1. Let _locale_ be r.[[locale]]. | ||
|
|
@@ -341,7 +341,7 @@ contributors: Ujjwal Sharma, Younies Mahmoud | |
| 1. Let _style_ be ? GetOption(_options_, `"style"`, `"string"`, « `"long"`, `"short"`, `"narrow"`, `"digital"` », `"long"`). | ||
| 1. Set _durationFormat_.[[Style]] to _style_. | ||
| 1. Set _durationFormat_.[[DataLocale]] to _r_.[[dataLocale]]. | ||
| 1. Let _prevStyle_ be *undefined*. | ||
| 1. Let _prevStyle_ be the empty String. | ||
| 1. For each row in <emu-xref href="#table-duration-components"></emu-xref>, except the header row, in table order, do | ||
| 1. Let _styleSlot_ be the Style Slot value. | ||
| 1. Let _displaySlot_ be the Display Slot value. | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose I keep falling in the JavaScript trap of "this will be freed once out of scope" 🤦