1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 08:08:12 +00:00

LibJS: Return a bool from Object::put* to indicate success

This commit is contained in:
Linus Groh 2020-04-30 20:01:54 +01:00 committed by Andreas Kling
parent 6dbb5df81f
commit 4cdd802927
4 changed files with 24 additions and 21 deletions

View file

@ -65,12 +65,13 @@ Value Uint8ClampedArray::length_getter(Interpreter& interpreter)
return Value(static_cast<const Uint8ClampedArray*>(this_object)->length());
}
void Uint8ClampedArray::put_by_index(i32 property_index, Value value, u8)
bool Uint8ClampedArray::put_by_index(i32 property_index, Value value, u8)
{
// FIXME: Use attributes
ASSERT(property_index >= 0);
ASSERT(property_index < m_length);
m_data[property_index] = clamp(value.to_i32(), 0, 255);
return true;
}
Value Uint8ClampedArray::get_by_index(i32 property_index) const