mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 11:37:34 +00:00
LibJS: Raise the upper minimum/maximum fraction digit limit to 100
This is a normative change in the ECMA-402 spec. See:
f6d2945
This commit is contained in:
parent
3fdf5072ec
commit
ea774111e8
3 changed files with 24 additions and 24 deletions
|
@ -128,15 +128,15 @@ describe("errors", () => {
|
|||
|
||||
expect(() => {
|
||||
new Intl.NumberFormat("en", { minimumFractionDigits: "hello!" });
|
||||
}).toThrowWithMessage(RangeError, "Value NaN is NaN or is not between 0 and 20");
|
||||
}).toThrowWithMessage(RangeError, "Value NaN is NaN or is not between 0 and 100");
|
||||
|
||||
expect(() => {
|
||||
new Intl.NumberFormat("en", { minimumFractionDigits: -1 });
|
||||
}).toThrowWithMessage(RangeError, "Value -1 is NaN or is not between 0 and 20");
|
||||
}).toThrowWithMessage(RangeError, "Value -1 is NaN or is not between 0 and 100");
|
||||
|
||||
expect(() => {
|
||||
new Intl.NumberFormat("en", { minimumFractionDigits: 21 });
|
||||
}).toThrowWithMessage(RangeError, "Value 21 is NaN or is not between 0 and 20");
|
||||
new Intl.NumberFormat("en", { minimumFractionDigits: 101 });
|
||||
}).toThrowWithMessage(RangeError, "Value 101 is NaN or is not between 0 and 100");
|
||||
});
|
||||
|
||||
test("maximumFractionDigits option is invalid ", () => {
|
||||
|
@ -146,15 +146,15 @@ describe("errors", () => {
|
|||
|
||||
expect(() => {
|
||||
new Intl.NumberFormat("en", { maximumFractionDigits: "hello!" });
|
||||
}).toThrowWithMessage(RangeError, "Value NaN is NaN or is not between 0 and 20");
|
||||
}).toThrowWithMessage(RangeError, "Value NaN is NaN or is not between 0 and 100");
|
||||
|
||||
expect(() => {
|
||||
new Intl.NumberFormat("en", { maximumFractionDigits: -1 });
|
||||
}).toThrowWithMessage(RangeError, "Value -1 is NaN or is not between 0 and 20");
|
||||
}).toThrowWithMessage(RangeError, "Value -1 is NaN or is not between 0 and 100");
|
||||
|
||||
expect(() => {
|
||||
new Intl.NumberFormat("en", { maximumFractionDigits: 21 });
|
||||
}).toThrowWithMessage(RangeError, "Value 21 is NaN or is not between 0 and 20");
|
||||
new Intl.NumberFormat("en", { maximumFractionDigits: 101 });
|
||||
}).toThrowWithMessage(RangeError, "Value 101 is NaN or is not between 0 and 100");
|
||||
|
||||
expect(() => {
|
||||
new Intl.NumberFormat("en", { minimumFractionDigits: 10, maximumFractionDigits: 5 });
|
||||
|
@ -370,7 +370,7 @@ describe("normal behavior", () => {
|
|||
});
|
||||
|
||||
test("all valid minimumFractionDigits options", () => {
|
||||
for (let i = 0; i <= 20; ++i) {
|
||||
for (let i = 0; i <= 100; ++i) {
|
||||
expect(() => {
|
||||
new Intl.NumberFormat("en", { minimumFractionDigits: i });
|
||||
}).not.toThrow();
|
||||
|
@ -378,7 +378,7 @@ describe("normal behavior", () => {
|
|||
});
|
||||
|
||||
test("all valid maximumFractionDigits options", () => {
|
||||
for (let i = 0; i <= 20; ++i) {
|
||||
for (let i = 0; i <= 100; ++i) {
|
||||
expect(() => {
|
||||
new Intl.NumberFormat("en", { maximumFractionDigits: i });
|
||||
}).not.toThrow();
|
||||
|
|
|
@ -48,15 +48,15 @@ describe("errors", () => {
|
|||
|
||||
expect(() => {
|
||||
new Intl.PluralRules("en", { minimumFractionDigits: "hello!" });
|
||||
}).toThrowWithMessage(RangeError, "Value NaN is NaN or is not between 0 and 20");
|
||||
}).toThrowWithMessage(RangeError, "Value NaN is NaN or is not between 0 and 100");
|
||||
|
||||
expect(() => {
|
||||
new Intl.PluralRules("en", { minimumFractionDigits: -1 });
|
||||
}).toThrowWithMessage(RangeError, "Value -1 is NaN or is not between 0 and 20");
|
||||
}).toThrowWithMessage(RangeError, "Value -1 is NaN or is not between 0 and 100");
|
||||
|
||||
expect(() => {
|
||||
new Intl.PluralRules("en", { minimumFractionDigits: 21 });
|
||||
}).toThrowWithMessage(RangeError, "Value 21 is NaN or is not between 0 and 20");
|
||||
new Intl.PluralRules("en", { minimumFractionDigits: 101 });
|
||||
}).toThrowWithMessage(RangeError, "Value 101 is NaN or is not between 0 and 100");
|
||||
});
|
||||
|
||||
test("maximumFractionDigits option is invalid ", () => {
|
||||
|
@ -66,15 +66,15 @@ describe("errors", () => {
|
|||
|
||||
expect(() => {
|
||||
new Intl.PluralRules("en", { maximumFractionDigits: "hello!" });
|
||||
}).toThrowWithMessage(RangeError, "Value NaN is NaN or is not between 0 and 20");
|
||||
}).toThrowWithMessage(RangeError, "Value NaN is NaN or is not between 0 and 100");
|
||||
|
||||
expect(() => {
|
||||
new Intl.PluralRules("en", { maximumFractionDigits: -1 });
|
||||
}).toThrowWithMessage(RangeError, "Value -1 is NaN or is not between 0 and 20");
|
||||
}).toThrowWithMessage(RangeError, "Value -1 is NaN or is not between 0 and 100");
|
||||
|
||||
expect(() => {
|
||||
new Intl.PluralRules("en", { maximumFractionDigits: 21 });
|
||||
}).toThrowWithMessage(RangeError, "Value 21 is NaN or is not between 0 and 20");
|
||||
new Intl.PluralRules("en", { maximumFractionDigits: 101 });
|
||||
}).toThrowWithMessage(RangeError, "Value 101 is NaN or is not between 0 and 100");
|
||||
|
||||
expect(() => {
|
||||
new Intl.PluralRules("en", { minimumFractionDigits: 10, maximumFractionDigits: 5 });
|
||||
|
@ -208,7 +208,7 @@ describe("normal behavior", () => {
|
|||
});
|
||||
|
||||
test("all valid minimumFractionDigits options", () => {
|
||||
for (let i = 0; i <= 20; ++i) {
|
||||
for (let i = 0; i <= 100; ++i) {
|
||||
expect(() => {
|
||||
new Intl.PluralRules("en", { minimumFractionDigits: i });
|
||||
}).not.toThrow();
|
||||
|
@ -216,7 +216,7 @@ describe("normal behavior", () => {
|
|||
});
|
||||
|
||||
test("all valid maximumFractionDigits options", () => {
|
||||
for (let i = 0; i <= 20; ++i) {
|
||||
for (let i = 0; i <= 100; ++i) {
|
||||
expect(() => {
|
||||
new Intl.PluralRules("en", { maximumFractionDigits: i });
|
||||
}).not.toThrow();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue