let inheritedTests = {...localeTests.long, ...localeTests.short, ...localeTests.narrow}; for (let [dayPeriod, expected] of Object.entries({...inheritedTests, ...styleTests})) {
assertEq(dn.of(dayPeriod), expected);
// Also works with objects.
assertEq(dn.of(Object(dayPeriod)), expected);
}
}
}
{
let dn = new Intl.DisplayNames("en", {type: "dayPeriod"});
// Performs ToString on the input and then validates the stringified result.
assertThrowsInstanceOf(() => dn.of(), RangeError);
assertThrowsInstanceOf(() => dn.of(null), RangeError);
assertThrowsInstanceOf(() => dn.of(Symbol()), TypeError);
assertThrowsInstanceOf(() => dn.of(0), RangeError);
assertThrowsInstanceOf(() => dn.of(1), RangeError);
// Throws an error if not one of ["am", "pm"].
assertThrowsInstanceOf(() => dn.of(""), RangeError);
assertThrowsInstanceOf(() => dn.of("AM"), RangeError);
assertThrowsInstanceOf(() => dn.of("PM"), RangeError);
}
if (typeof reportCompare === "function")
reportCompare(true, true);
Messung V0.5
¤ Dauer der Verarbeitung: 0.10 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.