Skip to content

Commit

Permalink
Incorporated anba suggestion for always throwing RangeError whenever …
Browse files Browse the repository at this point in the history
…display: "always" is used for sub-second units with "numeric" style
  • Loading branch information
ben-allen committed Nov 13, 2023
1 parent 42730c0 commit 1bfcb45
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions spec.emu
Original file line number Diff line number Diff line change
Expand Up @@ -216,15 +216,17 @@ contributors: Ujjwal Sharma, Younies Mahmoud
1. Set _style_ to *"numeric"*.
1. Else,
1. Set _style_ to _baseStyle_.
1. Else if _style_ is *"numeric"* and _unit_ is one of *"milliseconds"*, *"microseconds"*, or *"nanoseconds"*, then
1. Set _displayDefault_ to *"auto"*.
1. Let _displayField_ be the string-concatenation of _unit_ and *"Display"*.
1. Let _display_ be ? GetOption(_options_, _displayField_, ~string~, « *"auto"*, *"always"* », _displayDefault_).
1. If _prevStyle_ is *"numeric"* or *"2-digit"*, then
1. If _style_ is not *"numeric"* or *"2-digit"*, then
1. Throw a *RangeError* exception.
1. Else if _unit_ is *"minutes"* or *"seconds"*, then
1. Set _style_ to *"2-digit"*.
1. If _style_ is *"numeric"* and _display_ is *"always"* and _unit_ is one of *"milliseconds"*, *"microseconds"*, or *"nanoseconds"*, then
1. Throw a *RangeError* exception.
1. If _style_ is *"numeric"* and _display_ is *"always"* and _unit_ is one of *"milliseconds"*, *"microseconds"*, or *"nanoseconds"*, then
1. Throw a *RangeError* exception.
1. Return the Record {
[[Style]]: _style_,
[[Display]]: _display_
Expand Down

0 comments on commit 1bfcb45

Please sign in to comment.