mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-01 12:07:14 +02:00
LibJS: Use implicit ThrowCompletionOr<T> constructor where possible
Luckily this is not very widespread yet as most of it would happen in the various JS functions instead of AOs.
This commit is contained in:
Notes:
sideshowbarker
2024-07-18 02:06:37 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/0881f8160fd Pull-request: https://github.com/SerenityOS/serenity/pull/10548 Reviewed-by: https://github.com/IdanHo ✅
@@ -657,7 +657,7 @@ ThrowCompletionOr<Optional<int>> default_number_option(GlobalObject& global_obje
|
||||
return vm.throw_completion<RangeError>(global_object, ErrorType::IntlNumberIsNaNOrOutOfRange, value, minimum, maximum);
|
||||
|
||||
// 4. Return floor(value).
|
||||
return { floor(value.as_double()) };
|
||||
return floor(value.as_double());
|
||||
}
|
||||
|
||||
// 9.2.15 GetNumberOption ( options, property, minimum, maximum, fallback ), https://tc39.es/ecma402/#sec-getnumberoption
|
||||
|
||||
Reference in New Issue
Block a user