From c39f3786544da94a27bca3b8313699845cf91e46 Mon Sep 17 00:00:00 2001 From: Philip Chimento Date: Thu, 12 Sep 2024 12:29:13 -0700 Subject: [PATCH] Editorial: Change FormatDateTimePattern to not return Completion Record It can no longer throw, but we didn't notice that because of a bug in ecmarkup (https://github.com/tc39/ecmarkup/issues/609). Change the return type, adjust the call sites not to unwrap the completion, and work around the ecmarkup bug with an editor's note and by putting the offending line in backticks so that ecmarkup doesn't consider it semantically. --- spec/intl.html | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/spec/intl.html b/spec/intl.html index d0005fed6..67b4229d3 100644 --- a/spec/intl.html +++ b/spec/intl.html @@ -901,15 +901,19 @@

_pattern_: a Pattern String, _x_: a Number, _epochNanoseconds_: a BigInt, - ): either a normal completion containing a List of Records with fields [[Type]] (a String) and [[Value]] (a String), or a throw completion + ): a List of Records with fields [[Type]] (a String) and [[Value]] (a String)

description
It interprets _x_ as a time value as specified in es2024, , and creates the corresponding parts for the epoch time _epochNanoseconds_ according to _pattern_ and to the effective locale and the formatting options of _dateTimeFormat_ and _format_.
+ + This operation changes to not return a Completion Record. + That usage of `<ins>` and `<del>` is not currently supported in ecmarkup, so that is not reflected in the text above. + 1. Let _x_ be TimeClip(_x_). - 1. If _x_ is *NaN*, throw a *RangeError* exception. + 1. `If _x_ is *NaN*, throw a *RangeError* exception.` 1. Let _locale_ be _dateTimeFormat_.[[Locale]]. 1. Let _nfOptions_ be OrdinaryObjectCreate(*null*). 1. Perform ! CreateDataPropertyOrThrow(_nfOptions_, *"useGrouping"*, *false*). @@ -1017,7 +1021,7 @@

1. Let _pattern_ be _format_.[[pattern12]]. 1. Else, 1. Let _pattern_ be _format_.[[pattern]]. - 1. Let _result_ be ? ! FormatDateTimePattern(_dateTimeFormat_, _format_, _pattern_, _x__xFormatRecord_.[[EpochNanoseconds]]). + 1. Let _result_ be ? FormatDateTimePattern(_dateTimeFormat_, _format_, _pattern_, _x__xFormatRecord_.[[EpochNanoseconds]]). 1. Return _result_. @@ -1126,7 +1130,7 @@

1. Set _relevantFieldsEqual_ to *false*. 1. If _relevantFieldsEqual_ is *true*, then 1. Let _collapsedResult_ be a new empty List. - 1. Let _resultParts_ be ! FormatDateTimePattern(_dateTimeFormat_, _format_, _pattern_, _x_). + 1. Let _resultParts_ be ! FormatDateTimePattern(_dateTimeFormat_, _format_, _pattern_, _x_). 1. For each Record { [[Type]], [[Value]] } _r_ of _resultParts_, do 1. Append the Record { [[Type]]: _r_.[[Type]], [[Value]]: _r_.[[Value]], [[Source]]: *"shared"* } to _collapsedResult_. 1. Return _collapsedResult_. @@ -1140,7 +1144,7 @@

1. Let _z_ be _x_. 1. Else, 1. Let _z_ be _y_. - 1. Let _resultParts_ be ! FormatDateTimePattern(_dateTimeFormat_, _selectedRangePattern_, _pattern_, _z_). + 1. Let _resultParts_ be ! FormatDateTimePattern(_dateTimeFormat_, _selectedRangePattern_, _pattern_, _z_). 1. For each Record { [[Type]], [[Value]] } _r_ of _resultParts_, do 1. Append the Record { [[Type]]: _r_.[[Type]], [[Value]]: _r_.[[Value]], [[Source]]: _source_ } to _rangeResult_. 1. Return _rangeResult_.