diff options
author | Idan Horowitz <idan.horowitz@gmail.com> | 2021-10-19 20:18:01 +0300 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2021-10-20 12:27:19 +0100 |
commit | 20163c058485dc524402c46f21bbe65a860bf9c5 (patch) | |
tree | 35e6942b65f8138ee073efcec6dae987d9ab0377 /Tests | |
parent | 3355b52cca1e1a8478ea5dbbd193120af4c83ca6 (diff) | |
download | serenity-20163c058485dc524402c46f21bbe65a860bf9c5.zip |
LibJS: Add ThrowCompletionOr versions of the JS native function macros
The old versions were renamed to JS_DECLARE_OLD_NATIVE_FUNCTION and
JS_DEFINE_OLD_NATIVE_FUNCTION, and will be eventually removed once all
native functions were converted to the new format.
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/LibWasm/test-wasm.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Tests/LibWasm/test-wasm.cpp b/Tests/LibWasm/test-wasm.cpp index e7d6237fc6..9847092750 100644 --- a/Tests/LibWasm/test-wasm.cpp +++ b/Tests/LibWasm/test-wasm.cpp @@ -62,8 +62,8 @@ public: ~WebAssemblyModule() override = default; private: - JS_DECLARE_NATIVE_FUNCTION(get_export); - JS_DECLARE_NATIVE_FUNCTION(wasm_invoke); + JS_DECLARE_OLD_NATIVE_FUNCTION(get_export); + JS_DECLARE_OLD_NATIVE_FUNCTION(wasm_invoke); static HashMap<Wasm::Linker::Name, Wasm::ExternValue> const& spec_test_namespace() { @@ -159,7 +159,7 @@ void WebAssemblyModule::initialize(JS::GlobalObject& global_object) define_native_function("invoke", wasm_invoke, 1, JS::default_attributes); } -JS_DEFINE_NATIVE_FUNCTION(WebAssemblyModule::get_export) +JS_DEFINE_OLD_NATIVE_FUNCTION(WebAssemblyModule::get_export) { auto name = TRY_OR_DISCARD(vm.argument(0).to_string(global_object)); auto this_value = vm.this_value(global_object); @@ -193,7 +193,7 @@ JS_DEFINE_NATIVE_FUNCTION(WebAssemblyModule::get_export) return {}; } -JS_DEFINE_NATIVE_FUNCTION(WebAssemblyModule::wasm_invoke) +JS_DEFINE_OLD_NATIVE_FUNCTION(WebAssemblyModule::wasm_invoke) { auto address = static_cast<unsigned long>(TRY_OR_DISCARD(vm.argument(0).to_double(global_object))); Wasm::FunctionAddress function_address { address }; |