Skip to content

Commit f0e53a7

Browse files
committed
Fix era canonicalization
Pretty sure this was supposed to return the Era value from the table, not the alias.
1 parent 2d79cbc commit f0e53a7

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4335,7 +4335,7 @@ <h1><span class="secnum">4.1.2</span> CanonicalizeEraInCalendar ( <var>calendar<
43354335
<p>The abstract operation CanonicalizeEraInCalendar takes arguments <var>calendar</var> (a String) and <var>era</var> (a String) and returns a String or <emu-val>undefined</emu-val>.
43364336
The following algorithm refers to the era data from <a href="https://unicode.org/reports/tr35/tr35-dates.html#Calendar_Data">UTS 35's Supplemental Calendar Data</a>.
43374337
It performs the following steps when called:</p>
4338-
<emu-alg><ol><li>For each row of <emu-xref href="#table-eras" id="_ref_4"><a href="#table-eras">Table 2</a></emu-xref>, do<ol><li>Let <var>cal</var> be the Calendar value of the current row.</li><li>If <var>cal</var> is equal to <var>calendar</var>, then<ol><li>Let <var>e</var> be the Era value of the current row.</li><li>If <var>e</var> is equal to <var>era</var>, return <var>era</var>.</li><li>Let <var>aliases</var> be a <emu-xref href="#sec-list-and-record-specification-type"><a href="https://tc39.es/ecma262/#sec-list-and-record-specification-type">List</a></emu-xref> whose elements are the strings given in the Aliases column of the row.</li><li>If <var>aliases</var> contains <var>era</var>, return <var>era</var>.</li></ol></li></ol></li><li>Return <emu-val>undefined</emu-val>.</li></ol></emu-alg>
4338+
<emu-alg><ol><li>For each row of <emu-xref href="#table-eras" id="_ref_4"><a href="#table-eras">Table 2</a></emu-xref>, do<ol><li>Let <var>cal</var> be the Calendar value of the current row.</li><li>If <var>cal</var> is equal to <var>calendar</var>, then<ol><li>Let <var>e</var> be the Era value of the current row.</li><li>If <var>e</var> is equal to <var>era</var>, return <var>era</var>.</li><li>Let <var>aliases</var> be a <emu-xref href="#sec-list-and-record-specification-type"><a href="https://tc39.es/ecma262/#sec-list-and-record-specification-type">List</a></emu-xref> whose elements are the strings given in the Aliases column of the row.</li><li>If <var>aliases</var> contains <var>era</var>, return <var>e</var>.</li></ol></li></ol></li><li>Return <emu-val>undefined</emu-val>.</li></ol></emu-alg>
43394339
</emu-clause>
43404340
43414341
<emu-clause id="sec-temporal-isvalidmonthecodeforcalendar" type="abstract operation" aoid="IsValidMonthCodeForCalendar">

spec.emu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ contributors: Google, Ecma International
445445
1. Let _e_ be the Era value of the current row.
446446
1. If _e_ is equal to _era_, return _era_.
447447
1. Let _aliases_ be a List whose elements are the strings given in the Aliases column of the row.
448-
1. If _aliases_ contains _era_, return _era_.
448+
1. If _aliases_ contains _era_, return _e_.
449449
1. Return *undefined*.
450450
</emu-alg>
451451
</emu-clause>

0 commit comments

Comments
 (0)