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:
parent
4ee58d36c0
commit
67a5e9f018
2 changed files with 14 additions and 4 deletions
|
@ -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", () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue