diff --git a/src/js_list.hpp b/src/js_list.hpp index c60e3028..dc6ad34c 100644 --- a/src/js_list.hpp +++ b/src/js_list.hpp @@ -273,7 +273,7 @@ void ListClass::add_listener(ContextType ctx, FunctionType, ObjectType this_o ValueType arguments[2]; arguments[0] = static_cast(protected_this); arguments[1] = CollectionClass::create_collection_change_set(protected_ctx, change_set); - Function::call(protected_ctx, protected_callback, protected_this, 2, arguments); + Function::callback(protected_ctx, protected_callback, protected_this, 2, arguments); }); list->m_notification_tokens.emplace_back(protected_callback, std::move(token)); } diff --git a/src/js_realm.hpp b/src/js_realm.hpp index 5d2a0aa4..17a57b7c 100644 --- a/src/js_realm.hpp +++ b/src/js_realm.hpp @@ -132,7 +132,7 @@ class RealmDelegate : public BindingContext { std::list> notifications_copy(m_notifications); for (auto &callback : notifications_copy) { - Function::call(m_context, callback, realm_object, 2, arguments); + Function::callback(m_context, callback, realm_object, 2, arguments); } } @@ -603,7 +603,7 @@ void RealmClass::wait_for_download_completion(ContextType ctx, FunctionType, ValueType callback_arguments[1]; callback_arguments[0] = object; - Function::call(protected_ctx, protected_callback, protected_this, 1, callback_arguments); + Function::callback(protected_ctx, protected_callback, protected_this, 1, callback_arguments); return; } } @@ -611,7 +611,7 @@ void RealmClass::wait_for_download_completion(ContextType ctx, FunctionType, ValueType callback_arguments[1]; callback_arguments[0] = Value::from_null(ctx); - Function::call(ctx, callback_function, this_object, 1, callback_arguments); + Function::callback(ctx, callback_function, this_object, 1, callback_arguments); } template diff --git a/src/js_results.hpp b/src/js_results.hpp index 317e166a..05a962bc 100644 --- a/src/js_results.hpp +++ b/src/js_results.hpp @@ -254,7 +254,7 @@ void ResultsClass::add_listener(ContextType ctx, FunctionType, ObjectType thi ValueType arguments[2]; arguments[0] = static_cast(protected_this); arguments[1] = CollectionClass::create_collection_change_set(protected_ctx, change_set); - Function::call(protected_ctx, protected_callback, protected_this, 2, arguments); + Function::callback(protected_ctx, protected_callback, protected_this, 2, arguments); }); results->m_notification_tokens.emplace_back(protected_callback, std::move(token)); } diff --git a/src/js_sync.hpp b/src/js_sync.hpp index f1295ab9..9e362271 100644 --- a/src/js_sync.hpp +++ b/src/js_sync.hpp @@ -234,7 +234,7 @@ public: arguments[0] = create_object>(m_ctx, new WeakSession(session)); arguments[1] = error_object; - Function::call(m_ctx, m_func, 2, arguments); + Function::callback(m_ctx, m_func, typename T::Object(), 2, arguments); } private: const Protected m_ctx;