5#ifndef MOLYBDEN_JS_PROXY_FUNCTION_HPP
6#define MOLYBDEN_JS_PROXY_FUNCTION_HPP
10#include "molybden/js/js_accessible.hpp"
17class JsProxyFunctionObjectBase
18 :
public JsAccessible<JsProxyFunctionObjectBase> {
20 static constexpr char kInvokeMethodName[] =
"Invoke";
23template <
class R,
class... T>
24class JsProxyFunctionObject :
public JsProxyFunctionObjectBase {
26 explicit JsProxyFunctionObject(std::function<R(T...)> function)
27 : callback_(std::move(function)) {}
29 R Invoke(T... args) {
return callback_(args...); }
32 std::function<R(T...)> callback_;
35 JS_ACCESSIBLE_METHOD(Invoke);