mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 09:37:34 +00:00
LibJS: Add HasProperty to TypedArray
This commit is contained in:
parent
f102b56345
commit
105e72cdad
1 changed files with 9 additions and 0 deletions
|
@ -101,6 +101,15 @@ public:
|
||||||
return viewed_array_buffer()->template get_value<T>(indexed_position.value(), true, ArrayBuffer::Order::Unordered);
|
return viewed_array_buffer()->template get_value<T>(indexed_position.value(), true, ArrayBuffer::Order::Unordered);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 10.4.5.2 [[HasProperty]] ( P ), https://tc39.es/ecma262/#sec-integer-indexed-exotic-objects-hasproperty-p
|
||||||
|
bool has_property(const PropertyName& name) const override
|
||||||
|
{
|
||||||
|
if (name.is_number()) {
|
||||||
|
return is_valid_integer_index(name.as_number());
|
||||||
|
}
|
||||||
|
return Object::has_property(name);
|
||||||
|
}
|
||||||
|
|
||||||
Span<const UnderlyingBufferDataType> data() const
|
Span<const UnderlyingBufferDataType> data() const
|
||||||
{
|
{
|
||||||
return { reinterpret_cast<const UnderlyingBufferDataType*>(m_viewed_array_buffer->buffer().data() + m_byte_offset), m_array_length };
|
return { reinterpret_cast<const UnderlyingBufferDataType*>(m_viewed_array_buffer->buffer().data() + m_byte_offset), m_array_length };
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue