1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:38:11 +00:00

LibJS: Add left shift & right shift operator support for BigIntegers

Based on https://tc39.es/ecma262/#sec-numeric-types-bigint-leftShift
(This commit also includes the matching tests)
This commit is contained in:
Idan Horowitz 2021-05-31 20:27:44 +03:00 committed by Linus Groh
parent 4ee58d36c0
commit 67a5e9f018
2 changed files with 14 additions and 4 deletions

View file

@ -28,6 +28,8 @@ describe("correct behavior", () => {
expect(1n | 2n).toBe(3n);
expect(5n ^ 3n).toBe(6n);
expect(~1n).toBe(-2n);
expect(5n << 2n).toBe(20n);
expect(7n >> 1n).toBe(3n);
});
test("increment operators", () => {