LibJS: Implement BigInt loose-equality according to the spec

This commit is contained in:
Timothy Flynn 2022-01-31 10:24:12 -05:00 committed by Linus Groh
commit 9ad3debf35
Notes: sideshowbarker 2024-07-17 19:55:30 +09:00
2 changed files with 16 additions and 6 deletions

View file

@ -99,6 +99,16 @@ describe("correct behavior", () => {
expect(Object(2n) == 1n).toBeFalse();
expect(1n != Object(2n)).toBeTrue();
expect(Object(2n) != 1n).toBeTrue();
expect(2n == "2").toBeTrue();
expect(2n == "0b10").toBeTrue();
expect(2n == "0o2").toBeTrue();
expect(2n == "0x2").toBeTrue();
expect(1n == "2").toBeFalse();
expect(1n == "0b10").toBeFalse();
expect(1n == "0o2").toBeFalse();
expect(1n == "0x2").toBeFalse();
});
test("strong equality operators", () => {