mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-01 07:52:50 +00:00
LibJS: Implement bitwise assignment operators (&=, |=, ^=)
This commit is contained in:
parent
8e4301dea6
commit
3e754a15d4
Notes:
sideshowbarker
2024-07-19 06:58:00 +09:00
Author: https://github.com/linusg
Commit: 3e754a15d4
Pull-request: https://github.com/SerenityOS/serenity/pull/2105
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