| 238 | } |
| 239 | |
| 240 | ContextImpl* ContextImpl::ctor(const maajs::CallbackInfo& info) |
| 241 | { |
| 242 | if (info.Length() == 1) { |
| 243 | try { |
| 244 | MaaContext* handle = reinterpret_cast<MaaContext*>(std::stoull(info[0].As<maajs::StringType>().Utf8Value())); |
| 245 | return new ContextImpl { handle }; |
| 246 | } |
| 247 | catch (std::exception&) { |
| 248 | return nullptr; |
| 249 | } |
| 250 | } |
| 251 | return nullptr; |
| 252 | } |
| 253 | |
| 254 | void ContextImpl::init_proto(maajs::ObjectType proto, maajs::FunctionType) |
| 255 | { |