mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 20:29:18 +00:00
LibJS: Convert Object::get() to ThrowCompletionOr
To no one's surprise, this patch is pretty big - this is possibly the most used AO of all of them. Definitely worth it though.
This commit is contained in:
parent
9b6c09e2c4
commit
b7e5f08e56
Notes:
sideshowbarker
2024-07-18 03:07:41 +09:00
Author: https://github.com/linusg
Commit: b7e5f08e56
Pull-request: https://github.com/SerenityOS/serenity/pull/10327
Reviewed-by: https://github.com/IdanHo ✅
61 changed files with 326 additions and 686 deletions
|
@ -43,9 +43,7 @@ ThrowCompletionOr<void> Error::install_error_cause(Value options)
|
|||
return throw_completion(exception->value());
|
||||
if (has_property) {
|
||||
// a. Let cause be ? Get(options, "cause").
|
||||
auto cause = options.as_object().get(vm.names.cause);
|
||||
if (auto* exception = vm.exception())
|
||||
return throw_completion(exception->value());
|
||||
auto cause = TRY(options.as_object().get(vm.names.cause));
|
||||
|
||||
// b. Perform ! CreateNonEnumerableDataPropertyOrThrow(O, "cause", cause).
|
||||
create_non_enumerable_data_property_or_throw(vm.names.cause, cause);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue