mirror of https://github.com/tc39/test262.git
Temporal: Fix Japanese era test
This mistakenly used a previous name for the helper function. Also adds a couple of debugging messages.
This commit is contained in:
parent
242f6f98f0
commit
3b89be9c5d
|
@ -127,7 +127,7 @@ var TemporalHelpers = {
|
||||||
* Return the canonical era code.
|
* Return the canonical era code.
|
||||||
*/
|
*/
|
||||||
canonicalizeCalendarEra(calendarId, eraName) {
|
canonicalizeCalendarEra(calendarId, eraName) {
|
||||||
assert.sameValue(typeof calendarId, "string");
|
assert.sameValue(typeof calendarId, "string", "calendar must be string in canonicalizeCalendarEra");
|
||||||
|
|
||||||
if (calendarId === "iso8601") {
|
if (calendarId === "iso8601") {
|
||||||
assert.sameValue(eraName, undefined);
|
assert.sameValue(eraName, undefined);
|
||||||
|
@ -138,7 +138,7 @@ var TemporalHelpers = {
|
||||||
if (eraName === undefined) {
|
if (eraName === undefined) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
assert.sameValue(typeof eraName, "string");
|
assert.sameValue(typeof eraName, "string", "eraName must be string or undefined in canonicalizeCalendarEra");
|
||||||
|
|
||||||
for (let {era, aliases = []} of TemporalHelpers.CalendarEras[calendarId]) {
|
for (let {era, aliases = []} of TemporalHelpers.CalendarEras[calendarId]) {
|
||||||
if (era === eraName || aliases.includes(eraName)) {
|
if (era === eraName || aliases.includes(eraName)) {
|
||||||
|
|
|
@ -69,8 +69,8 @@ date = Temporal.PlainDate.from({
|
||||||
});
|
});
|
||||||
assert.sameValue(`${date}`, "1000-01-01[u-ca=japanese]");
|
assert.sameValue(`${date}`, "1000-01-01[u-ca=japanese]");
|
||||||
assert.sameValue(
|
assert.sameValue(
|
||||||
TemporalHelpers.canonicalizeEraInCalendar(date, date.era),
|
TemporalHelpers.canonicalizeCalendarEra(date.calendarId, date.era),
|
||||||
TemporalHelpers.canonicalizeEraInCalendar(date, "ce"),
|
TemporalHelpers.canonicalizeCalendarEra(date.calendarId, "ce"),
|
||||||
);
|
);
|
||||||
assert.sameValue(date.eraYear, 1000);
|
assert.sameValue(date.eraYear, 1000);
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ date = Temporal.PlainDate.from({
|
||||||
});
|
});
|
||||||
assert.sameValue(`${date}`, "0000-01-01[u-ca=japanese]");
|
assert.sameValue(`${date}`, "0000-01-01[u-ca=japanese]");
|
||||||
assert.sameValue(
|
assert.sameValue(
|
||||||
TemporalHelpers.canonicalizeEraInCalendar(date, date.era),
|
TemporalHelpers.canonicalizeCalendarEra(date.calendarId, date.era),
|
||||||
TemporalHelpers.canonicalizeEraInCalendar(date, "bce"),
|
TemporalHelpers.canonicalizeCalendarEra(date.calendarId, "bce"),
|
||||||
);
|
);
|
||||||
assert.sameValue(date.eraYear, 1);
|
assert.sameValue(date.eraYear, 1);
|
||||||
|
|
Loading…
Reference in New Issue