summaryrefslogtreecommitdiff
path: root/Libraries/LibJS/Runtime/Uint8ClampedArray.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Libraries/LibJS/Runtime/Uint8ClampedArray.cpp')
-rw-r--r--Libraries/LibJS/Runtime/Uint8ClampedArray.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/Libraries/LibJS/Runtime/Uint8ClampedArray.cpp b/Libraries/LibJS/Runtime/Uint8ClampedArray.cpp
index bd9b6e5367..aa5bcbf36c 100644
--- a/Libraries/LibJS/Runtime/Uint8ClampedArray.cpp
+++ b/Libraries/LibJS/Runtime/Uint8ClampedArray.cpp
@@ -67,8 +67,8 @@ JS_DEFINE_NATIVE_GETTER(Uint8ClampedArray::length_getter)
bool Uint8ClampedArray::put_by_index(u32 property_index, Value value)
{
- // FIXME: Use attributes
- ASSERT(property_index < m_length);
+ if (property_index >= m_length)
+ return Base::put_by_index(property_index, value);
auto number = value.to_i32(global_object());
if (vm().exception())
return {};
@@ -78,7 +78,8 @@ bool Uint8ClampedArray::put_by_index(u32 property_index, Value value)
Value Uint8ClampedArray::get_by_index(u32 property_index) const
{
- ASSERT(property_index < m_length);
+ if (property_index >= m_length)
+ return Base::get_by_index(property_index);
return Value((i32)m_data[property_index]);
}