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:
parent
8e4301dea6
commit
3e754a15d4
8 changed files with 62 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue