15 #ifndef SHAKA_EMBEDDED_MAPPING_CALLBACK_H_ 16 #define SHAKA_EMBEDDED_MAPPING_CALLBACK_H_ 40 static std::string
name() {
53 return callback_.
empty();
57 return callback_ == other.callback_;
60 return callback_ != other.callback_;
63 template <
typename... Args>
66 std::forward<Args>(args)...);
67 if (holds_alternative<js::JsError>(exception)) {
73 template <
typename T,
typename... Args>
75 Args&&... args)
const {
77 return CallInternal(that_val, std::forward<Args>(args)...);
80 bool TryConvert(Handle<JsValue> given)
override;
81 ReturnVal<JsValue>
ToJsValue()
const override;
85 template <
typename... Args>
90 LocalVar<JsObject> that_obj = UnsafeJsCast<JsObject>(that);
93 LocalVar<JsValue> arguments[] = {
95 LocalVar<JsValue> except;
108 #endif // SHAKA_EMBEDDED_MAPPING_CALLBACK_H_
ReturnVal< JsValue > JsUndefined()
bool IsObject(Handle< JsValue > value)
static JsError Rethrow(Handle< JsValue > error)
bool InvokeMethod(Handle< JsFunction > method, Handle< JsObject > that, int argc, LocalVar< JsValue > *argv, LocalVar< JsValue > *result_or_except)
bool operator==(const Callback &other) const
ReturnVal< JsValue > ToJsValue(T &&source)
Callback & operator=(const Callback &)
ReturnVal< JsValue > ToJsValue() const override
static JsEngine * Instance()
bool operator!=(const Callback &other) const
void Trace(memory::HeapTracer *tracer) const override
bool TryConvert(Handle< JsValue > given) override
MUST_USE_RESULT ExceptionOr< void > CallWithThis(T &&that, Args &&... args) const
static std::string name()
Handle< T > handle() const
void OnUncaughtException(JSValueRef exception, bool in_promise)
void operator()(Args &&... args) const