mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +00:00
LibJS: Convert internal_prevent_extensions() to ThrowCompletionOr
This commit is contained in:
parent
9b4362f10a
commit
73bae7d779
Notes:
sideshowbarker
2024-07-18 03:19:26 +09:00
Author: https://github.com/linusg
Commit: 73bae7d779
Pull-request: https://github.com/SerenityOS/serenity/pull/10266
Reviewed-by: https://github.com/IdanHo ✅
12 changed files with 22 additions and 30 deletions
|
@ -208,9 +208,7 @@ JS_DEFINE_NATIVE_FUNCTION(ObjectConstructor::prevent_extensions)
|
|||
auto argument = vm.argument(0);
|
||||
if (!argument.is_object())
|
||||
return argument;
|
||||
auto status = argument.as_object().internal_prevent_extensions();
|
||||
if (vm.exception())
|
||||
return {};
|
||||
auto status = TRY_OR_DISCARD(argument.as_object().internal_prevent_extensions());
|
||||
if (!status) {
|
||||
// FIXME: Improve/contextualize error message
|
||||
vm.throw_exception<TypeError>(global_object, ErrorType::ObjectPreventExtensionsReturnedFalse);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue