mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +00:00
LibJS: Convert to_object() to ThrowCompletionOr
This commit is contained in:
parent
9eb065a1f6
commit
52976bfac6
Notes:
sideshowbarker
2024-07-18 02:47:31 +09:00
Author: https://github.com/linusg
Commit: 52976bfac6
Pull-request: https://github.com/SerenityOS/serenity/pull/10452
Reviewed-by: https://github.com/IdanHo ✅
45 changed files with 239 additions and 490 deletions
|
@ -33,11 +33,7 @@ JS::Value WebAssemblyInstanceConstructor::construct(FunctionObject&)
|
|||
{
|
||||
auto& vm = this->vm();
|
||||
auto& global_object = this->global_object();
|
||||
|
||||
auto module_argument = vm.argument(0).to_object(global_object);
|
||||
if (vm.exception())
|
||||
return {};
|
||||
|
||||
auto* module_argument = TRY_OR_DISCARD(vm.argument(0).to_object(global_object));
|
||||
if (!is<WebAssemblyModuleObject>(module_argument)) {
|
||||
vm.throw_exception<JS::TypeError>(global_object, JS::ErrorType::NotAnObjectOfType, "WebAssembly.Module");
|
||||
return {};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue