#ifndef BOT_JS_V8INSTANCE #define BOT_JS_V8INSTANCE #include #include #include class APIHelper; class V8Instance { public: V8Instance(std::shared_ptr ah); ~V8Instance(); void reload(); void exec_js(std::string js, std::string channel_id); private: void clean_up(); void create(); v8::Local create_context(); static void js_print(const v8::FunctionCallbackInfo &args); v8::ArrayBuffer::Allocator *array_buffer_allocator; v8::Isolate *isolate; std::shared_ptr ah; std::string print_text; }; #endif