summaryrefslogtreecommitdiff
path: root/Userland/Libraries
diff options
context:
space:
mode:
authorIdan Horowitz <idan.horowitz@gmail.com>2021-10-31 16:55:06 +0200
committerIdan Horowitz <idan.horowitz@gmail.com>2021-10-31 18:20:37 +0200
commita8d39bc0707ffa23d4eaf476767bf891201d4056 (patch)
tree34eba3802934dde17919b2f92edcf07cc0174df0 /Userland/Libraries
parent3e8c76d5abc4f1f479b0aa108a3c92eda10a5e63 (diff)
downloadserenity-a8d39bc0707ffa23d4eaf476767bf891201d4056.zip
LibWeb: Convert WebAssemblyObject functions to ThrowCompletionOr
Diffstat (limited to 'Userland/Libraries')
-rw-r--r--Userland/Libraries/LibWeb/WebAssembly/WebAssemblyObject.cpp12
-rw-r--r--Userland/Libraries/LibWeb/WebAssembly/WebAssemblyObject.h6
2 files changed, 9 insertions, 9 deletions
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<size_t> 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<size_t> 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 {