mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-21 00:38:56 +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
Notes:
sideshowbarker
2024-07-18 17:05:51 +09:00
Author: https://github.com/IdanHo
Commit: 67a5e9f018
Pull-request: https://github.com/SerenityOS/serenity/pull/7639
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