1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 20:57:35 +00:00

LibJS: Implement missing conditional when creating a TypedArray subarray

This commit is contained in:
Timothy Flynn 2023-12-27 14:18:06 -05:00 committed by Tim Flynn
parent 522302d5d6
commit f1e01a681e
2 changed files with 19 additions and 1 deletions

View file

@ -1846,7 +1846,7 @@ JS_DEFINE_NATIVE_FUNCTION(TypedArrayPrototype::subarray)
MarkedVector<Value> arguments(vm.heap());
// 15. If O.[[ArrayLength]] is auto and end is undefined, then
if (typed_array->array_length().is_auto()) {
if (typed_array->array_length().is_auto() && end.is_undefined()) {
// a. Let argumentsList be « buffer, 𝔽(beginByteOffset) ».
arguments.empend(buffer);
arguments.empend(begin_byte_offset.value());