| 21 | } |
| 22 | |
| 23 | void ResourceSink(void* resource, const char* message, const char* details_json, void* callback_arg) |
| 24 | { |
| 25 | auto ctx = reinterpret_cast<maajs::CallbackContext*>(callback_arg); |
| 26 | ctx->Call<void>([=](maajs::FunctionType fn) { |
| 27 | auto res = ResourceImpl::locate_object(fn.Env(), reinterpret_cast<MaaResource*>(resource)); |
| 28 | auto detail = maajs::JsonParse(fn.Env(), details_json).As<maajs::ObjectType>(); |
| 29 | detail["msg"] = maajs::StringType::New(fn.Env(), RemovePrefix(message, "Resource.")); |
| 30 | return fn.Call( |
| 31 | { |
| 32 | res, |
| 33 | detail, |
| 34 | }); |
| 35 | }); |
| 36 | } |
| 37 | |
| 38 | void ControllerSink(void* controller, const char* message, const char* details_json, void* callback_arg) |
| 39 | { |
nothing calls this directly
no test coverage detected