mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-30 19:47:17 +02:00
LibJS: Convert get_method to ThrowCompletionOr
This commit is contained in:
Notes:
sideshowbarker
2024-07-18 03:31:02 +09:00
Author: https://github.com/IdanHo Commit: https://github.com/SerenityOS/serenity/commit/ee825d6d9e1 Pull-request: https://github.com/SerenityOS/serenity/pull/10190 Reviewed-by: https://github.com/davidot Reviewed-by: https://github.com/linusg ✅
@@ -365,9 +365,7 @@ ThrowCompletionOr<double> get_offset_nanoseconds_for(GlobalObject& global_object
|
||||
auto& vm = global_object.vm();
|
||||
|
||||
// 1. Let getOffsetNanosecondsFor be ? GetMethod(timeZone, "getOffsetNanosecondsFor").
|
||||
auto* get_offset_nanoseconds_for = time_zone.get_method(global_object, vm.names.getOffsetNanosecondsFor);
|
||||
if (auto* exception = vm.exception())
|
||||
return throw_completion(exception->value());
|
||||
auto* get_offset_nanoseconds_for = TRY(time_zone.get_method(global_object, vm.names.getOffsetNanosecondsFor));
|
||||
|
||||
// 2. If getOffsetNanosecondsFor is undefined, set getOffsetNanosecondsFor to %Temporal.TimeZone.prototype.getOffsetNanosecondsFor%.
|
||||
if (!get_offset_nanoseconds_for)
|
||||
|
||||
Reference in New Issue
Block a user