diff options
author | Linus Groh <mail@linusgroh.de> | 2021-09-29 00:13:41 +0100 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2021-09-29 23:49:53 +0100 |
commit | 73bae7d779ebbf14eec603d8619f4d5247a6e69a (patch) | |
tree | 85ef6f46da8ff1dd50d1295921fa0b211ac0970a /Userland/Libraries/LibJS/Runtime/ObjectConstructor.cpp | |
parent | 9b4362f10a5a87470f43c1086717daa9ce04bb08 (diff) | |
download | serenity-73bae7d779ebbf14eec603d8619f4d5247a6e69a.zip |
LibJS: Convert internal_prevent_extensions() to ThrowCompletionOr
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/ObjectConstructor.cpp')
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/ObjectConstructor.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/ObjectConstructor.cpp b/Userland/Libraries/LibJS/Runtime/ObjectConstructor.cpp index a93b509610..34b7d1c923 100644 --- a/Userland/Libraries/LibJS/Runtime/ObjectConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/ObjectConstructor.cpp @@ -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); |