1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 14:47:44 +00:00

LibJS: Implement bitwise unsigned right shift operator (>>>)

This commit is contained in:
Linus Groh 2020-04-23 15:43:10 +01:00 committed by Andreas Kling
parent 502d1f5165
commit 396ecfa2d7
6 changed files with 108 additions and 0 deletions

View file

@ -82,6 +82,12 @@ public:
m_value.as_double = value;
}
explicit Value(unsigned value)
: m_type(Type::Number)
{
m_value.as_double = static_cast<double>(value);
}
explicit Value(i32 value)
: m_type(Type::Number)
{
@ -207,6 +213,7 @@ Value unary_plus(Interpreter&, Value);
Value unary_minus(Interpreter&, Value);
Value left_shift(Interpreter&, Value lhs, Value rhs);
Value right_shift(Interpreter&, Value lhs, Value rhs);
Value unsigned_right_shift(Interpreter&, Value lhs, Value rhs);
Value add(Interpreter&, Value lhs, Value rhs);
Value sub(Interpreter&, Value lhs, Value rhs);
Value mul(Interpreter&, Value lhs, Value rhs);