mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-22 02:09:24 +00:00
LibJS: Convert to_string() to ThrowCompletionOr
Also update get_function_name() to use ThrowCompletionOr, but this is not a standard AO and should be refactored out of existence eventually.
This commit is contained in:
parent
5d38cf4973
commit
4d8912a92b
Notes:
sideshowbarker
2024-07-18 02:47:45 +09:00
Author: https://github.com/linusg
Commit: 4d8912a92b
Pull-request: https://github.com/SerenityOS/serenity/pull/10452
Reviewed-by: https://github.com/IdanHo ✅
48 changed files with 171 additions and 415 deletions
|
@ -319,9 +319,7 @@ JS_DEFINE_NATIVE_FUNCTION(DateConstructor::parse)
|
|||
if (!vm.argument_count())
|
||||
return js_nan();
|
||||
|
||||
auto date_string = vm.argument(0).to_string(global_object);
|
||||
if (vm.exception())
|
||||
return {};
|
||||
auto date_string = TRY_OR_DISCARD(vm.argument(0).to_string(global_object));
|
||||
|
||||
return parse_date_string(date_string);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue