diff options
author | Idan Horowitz <idan.horowitz@gmail.com> | 2021-10-17 23:43:29 +0300 |
---|---|---|
committer | Idan Horowitz <idan.horowitz@gmail.com> | 2021-10-18 08:01:38 +0300 |
commit | cc94bba5c0461eebeb13a063c844330b0234e0bd (patch) | |
tree | ef837c94a8d60e7a04d65cf1e52ea54c3799afb4 /Userland/Libraries/LibJS/Runtime/ArrayConstructor.cpp | |
parent | f6a5ff7b003930a1994c0f4c4a1c4b1da7c7123d (diff) | |
download | serenity-cc94bba5c0461eebeb13a063c844330b0234e0bd.zip |
LibJS: Convert to_u32() to ThrowCompletionOr
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/ArrayConstructor.cpp')
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/ArrayConstructor.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/ArrayConstructor.cpp b/Userland/Libraries/LibJS/Runtime/ArrayConstructor.cpp index 6d40742b56..4185fc4c95 100644 --- a/Userland/Libraries/LibJS/Runtime/ArrayConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/ArrayConstructor.cpp @@ -68,7 +68,7 @@ Value ArrayConstructor::construct(FunctionObject& new_target) MUST(array->create_data_property_or_throw(0, length)); int_length = 1; } else { - int_length = length.to_u32(global_object()); + int_length = MUST(length.to_u32(global_object())); if (int_length != length.as_double()) { vm.throw_exception<RangeError>(global_object(), ErrorType::InvalidLength, "array"); return {}; |