mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 02:05:07 +02:00
LibWeb: Convert WebAssemblyObject AOs to ThrowCompletionOr
This commit is contained in:
Notes:
sideshowbarker
2024-07-18 01:41:14 +09:00
Author: https://github.com/IdanHo Commit: https://github.com/SerenityOS/serenity/commit/3e8c76d5abc Pull-request: https://github.com/SerenityOS/serenity/pull/10728
@@ -34,13 +34,9 @@ JS::ThrowCompletionOr<JS::Object*> WebAssemblyModuleConstructor::construct(Funct
|
||||
auto& global_object = this->global_object();
|
||||
|
||||
auto* buffer_object = TRY(vm.argument(0).to_object(global_object));
|
||||
auto result = parse_module(global_object, buffer_object);
|
||||
if (result.is_error()) {
|
||||
vm.throw_exception(global_object, result.error());
|
||||
return JS::throw_completion(result.error());
|
||||
}
|
||||
auto result = TRY(parse_module(global_object, buffer_object));
|
||||
|
||||
return heap().allocate<WebAssemblyModuleObject>(global_object, global_object, result.release_value());
|
||||
return heap().allocate<WebAssemblyModuleObject>(global_object, global_object, result);
|
||||
}
|
||||
|
||||
void WebAssemblyModuleConstructor::initialize(JS::GlobalObject& global_object)
|
||||
|
||||
Reference in New Issue
Block a user