1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-16 19:45:07 +00:00

LibJS: Implement bitwise assignment operators (&=, |=, ^=)

This commit is contained in:
Linus Groh 2020-05-04 22:34:45 +01:00 committed by Andreas Kling
parent 8e4301dea6
commit 3e754a15d4
8 changed files with 62 additions and 2 deletions

View file

@ -23,6 +23,18 @@ try {
assert((x /= 2) === 3);
assert(x === 3);
x = 3;
assert((x &= 2) === 2);
assert(x === 2);
x = 3;
assert((x |= 4) === 7);
assert(x === 7);
x = 6;
assert((x ^= 2) === 4);
assert(x === 4);
x = 2;
assert((x <<= 2) === 8);
assert(x === 8);