@@ -54,7 +54,7 @@ class TypedArrayBase : public Object {
54
54
// 25.1.2.7 IsBigIntElementType ( type ), https://tc39.es/ecma262/#sec-isbigintelementtype
55
55
virtual bool is_bigint_element_type () const = 0;
56
56
// 25.1.2.10 GetValueFromBuffer ( arrayBuffer, byteIndex, type, isTypedArray, order [ , isLittleEndian ] ), https://tc39.es/ecma262/#sec-getvaluefrombuffer
57
- virtual Value get_value_from_buffer (size_t byte_index, ArrayBuffer::Order, bool is_little_endian = true ) const = 0;
57
+ virtual ThrowCompletionOr< Value> get_value_from_buffer (size_t byte_index, ArrayBuffer::Order, bool is_little_endian = true ) const = 0;
58
58
// 25.1.2.12 SetValueInBuffer ( arrayBuffer, byteIndex, type, value, isTypedArray, order [ , isLittleEndian ] ), https://tc39.es/ecma262/#sec-setvalueinbuffer
59
59
virtual void set_value_in_buffer (size_t byte_index, Value, ArrayBuffer::Order, bool is_little_endian = true ) = 0;
60
60
// 25.1.2.13 GetModifySetValueInBuffer ( arrayBuffer, byteIndex, type, value, op [ , isLittleEndian ] ), https://tc39.es/ecma262/#sec-getmodifysetvalueinbuffer
@@ -100,7 +100,7 @@ inline bool is_valid_integer_index(TypedArrayBase const& typed_array, CanonicalI
100
100
101
101
// 10.4.5.10 IntegerIndexedElementGet ( O, index ), https://tc39.es/ecma262/#sec-integerindexedelementget
102
102
template <typename T>
103
- inline Value integer_indexed_element_get (TypedArrayBase const & typed_array, CanonicalIndex property_index)
103
+ inline ThrowCompletionOr< Value> integer_indexed_element_get (TypedArrayBase const & typed_array, CanonicalIndex property_index)
104
104
{
105
105
// 1. If IsValidIntegerIndex(O, index) is false, return undefined.
106
106
if (!is_valid_integer_index (typed_array, property_index))
@@ -195,7 +195,7 @@ class TypedArray : public TypedArrayBase {
195
195
// b. If numericIndex is not undefined, then
196
196
if (!numeric_index.is_undefined ()) {
197
197
// i. Let value be IntegerIndexedElementGet(O, numericIndex).
198
- auto value = integer_indexed_element_get<T>(*this , numeric_index);
198
+ auto value = MUST_OR_THROW_OOM ( integer_indexed_element_get<T>(*this , numeric_index) );
199
199
200
200
// ii. If value is undefined, return undefined.
201
201
if (value.is_undefined ())
@@ -437,7 +437,7 @@ class TypedArray : public TypedArrayBase {
437
437
return is_bigint;
438
438
}
439
439
440
- Value get_value_from_buffer (size_t byte_index, ArrayBuffer::Order order, bool is_little_endian = true ) const override { return viewed_array_buffer ()->template get_value <T>(byte_index, true , order, is_little_endian); }
440
+ ThrowCompletionOr< Value> get_value_from_buffer (size_t byte_index, ArrayBuffer::Order order, bool is_little_endian = true ) const override { return viewed_array_buffer ()->template get_value <T>(byte_index, true , order, is_little_endian); }
441
441
void set_value_in_buffer (size_t byte_index, Value value, ArrayBuffer::Order order, bool is_little_endian = true ) override { viewed_array_buffer ()->template set_value <T>(byte_index, value, true , order, is_little_endian); }
442
442
ThrowCompletionOr<Value> get_modify_set_value_in_buffer (size_t byte_index, Value value, ReadWriteModifyFunction operation, bool is_little_endian = true ) override { return viewed_array_buffer ()->template get_modify_set_value <T>(byte_index, value, move (operation), is_little_endian); }
443
443
0 commit comments