From a8d39bc0707ffa23d4eaf476767bf891201d4056 Mon Sep 17 00:00:00 2001 From: Idan Horowitz Date: Sun, 31 Oct 2021 16:55:06 +0200 Subject: LibWeb: Convert WebAssemblyObject functions to ThrowCompletionOr --- Userland/Libraries/LibWeb/WebAssembly/WebAssemblyObject.cpp | 12 ++++++------ Userland/Libraries/LibWeb/WebAssembly/WebAssemblyObject.h | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'Userland/Libraries/LibWeb/WebAssembly') diff --git a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyObject.cpp b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyObject.cpp index 69d73dbf5d..18502d1f33 100644 --- a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyObject.cpp +++ b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyObject.cpp @@ -35,9 +35,9 @@ void WebAssemblyObject::initialize(JS::GlobalObject& global_object) Object::initialize(global_object); u8 attr = JS::Attribute::Configurable | JS::Attribute::Writable | JS::Attribute::Enumerable; - define_old_native_function("validate", validate, 1, attr); - define_old_native_function("compile", compile, 1, attr); - define_old_native_function("instantiate", instantiate, 1, attr); + define_native_function("validate", validate, 1, attr); + define_native_function("compile", compile, 1, attr); + define_native_function("instantiate", instantiate, 1, attr); auto& vm = global_object.vm(); @@ -87,7 +87,7 @@ void WebAssemblyObject::visit_edges(Visitor& visitor) } } -JS_DEFINE_OLD_NATIVE_FUNCTION(WebAssemblyObject::validate) +JS_DEFINE_NATIVE_FUNCTION(WebAssemblyObject::validate) { // FIXME: Implement this once module validation is implemented in LibWasm. dbgln("Hit WebAssemblyObject::validate() stub!"); @@ -127,7 +127,7 @@ JS::ThrowCompletionOr parse_module(JS::GlobalObject& global_object, JS:: return WebAssemblyObject::s_compiled_modules.size() - 1; } -JS_DEFINE_OLD_NATIVE_FUNCTION(WebAssemblyObject::compile) +JS_DEFINE_NATIVE_FUNCTION(WebAssemblyObject::compile) { // FIXME: This shouldn't block! auto buffer_or_error = vm.argument(0).to_object(global_object); @@ -291,7 +291,7 @@ JS::ThrowCompletionOr WebAssemblyObject::instantiate_module(Wasm::Module return s_instantiated_modules.size() - 1; } -JS_DEFINE_OLD_NATIVE_FUNCTION(WebAssemblyObject::instantiate) +JS_DEFINE_NATIVE_FUNCTION(WebAssemblyObject::instantiate) { // FIXME: This shouldn't block! auto buffer_or_error = vm.argument(0).to_object(global_object); diff --git a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyObject.h b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyObject.h index a421643973..834c2cc826 100644 --- a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyObject.h +++ b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyObject.h @@ -60,9 +60,9 @@ public: static Wasm::AbstractMachine s_abstract_machine; private: - JS_DECLARE_OLD_NATIVE_FUNCTION(validate); - JS_DECLARE_OLD_NATIVE_FUNCTION(compile); - JS_DECLARE_OLD_NATIVE_FUNCTION(instantiate); + JS_DECLARE_NATIVE_FUNCTION(validate); + JS_DECLARE_NATIVE_FUNCTION(compile); + JS_DECLARE_NATIVE_FUNCTION(instantiate); }; class WebAssemblyMemoryObject final : public JS::Object { -- cgit v1.2.3