5#ifndef MOLYBDEN_JS_OBJECT_DETAIL_HPP
6#define MOLYBDEN_JS_OBJECT_DETAIL_HPP
14 static_assert(internal::IsJsObject<T>::Value(),
15 "The object can only be casted to the JsObject subclass.");
29 return putPropertyValue(name,
JsValue::from(std::forward<T>(value)));
JsReturnValue call(const std::string &method_name, T &&... args)
Executes the method with the given method_name and the args in the JavaScript object.
Definition js_object_detail.hpp:23
std::shared_ptr< T > as()
Returns the shared pointer of type T to this object if it represents one, or nullptr otherwise.
Definition js_object_detail.hpp:13
bool putProperty(const std::string &name, T &&value)
Creates a new property with the given name or updates the existing one in the current JavaScript obje...
Definition js_object_detail.hpp:28
Represents the JS function return value.
Definition js_return_value.hpp:35
static JsValue from(T &&value)
Constructs a JavaScript value from the convertible C++ one.
Definition js_value_detail.hpp:51