Skip to content

Commit

Permalink
Move DurationSign from ECMA-402 and use real Duration objects
Browse files Browse the repository at this point in the history
DurationSign no longer needs to be defined by Temporal, as it's now part
of ECMA-402. However, when Temporal becomes part of ECMA-262, we do need
to move DurationSign into ECMA-262. Put it in a <del> block in intl.html.
We can keep the new definition in its current place in the spec while
adjusting its ID.

Once Temporal.Duration objects are introduced, there is no longer any need
for Duration Records. So, make the ECMA-402 DurationSign accept a
Temporal.Duration object (as it already did in Temporal), delete the
ToDurationRecord operation and the Duration Record definition, and change
several other operations from ECMA-402 to use Temporal.Duration objects
instead of Duration Records.

Temporarily, since these operations aren't yet in ecma402-biblio pending
tc39/ecma402#943, add a JSON bibliography file so
the references aren't dangling.
  • Loading branch information
ptomato committed Feb 13, 2025
1 parent 08bc1f1 commit 0cb16e1
Show file tree
Hide file tree
Showing 4 changed files with 378 additions and 3 deletions.
1 change: 1 addition & 0 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
contributors: Maggie Pint, Matt Johnson, Brian Terlson, Daniel Ehrenberg, Philipp Dunkel, Sasha Pierson, Ujjwal Sharma, Philip Chimento, Justin Grant
markEffects: true
</pre>
<emu-biblio href="spec/biblio.json"></emu-biblio>

<emu-intro id="sec-temporal-intro">
<h1>Introduction</h1>
Expand Down
37 changes: 37 additions & 0 deletions spec/biblio.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[
{
"location": "https://tc39.es/ecma402/",
"entries": [
{
"type": "op",
"aoid": "FormatNumericHours",
"id": "sec-formatnumerichours"
},
{
"type": "op",
"aoid": "FormatNumericMinutes",
"id": "sec-formatnumericminutes"
},
{
"type": "op",
"aoid": "FormatNumericSeconds",
"id": "sec-formatnumericseconds"
},
{
"type": "op",
"aoid": "NextUnitFractional",
"id": "sec-nextunitfractional"
},
{
"type": "op",
"aoid": "ListFormatParts",
"id": "sec-listformatparts"
},
{
"type": "clause",
"number": "Table 21",
"id": "table-partition-duration-format-pattern"
}
]
}
]
4 changes: 2 additions & 2 deletions spec/duration.html
Original file line number Diff line number Diff line change
Expand Up @@ -1096,10 +1096,10 @@ <h1>
</emu-alg>
</emu-clause>

<emu-clause id="sec-temporal-durationsign" type="abstract operation">
<emu-clause id="sec-durationsign" type="abstract operation">
<h1>
DurationSign (
_duration_: a Temporal.Duration,
_duration_: a <del>Duration Record</del><ins>Temporal.Duration</ins>,
): -1, 0, or 1
</h1>
<dl class="header">
Expand Down
Loading

0 comments on commit 0cb16e1

Please sign in to comment.