MCPcopy Create free account
hub / github.com/MaaXYZ/MaaFramework / ctor

Method ctor

source/binding/NodeJS/src/apis/context.cpp:240–252  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

238}
239
240ContextImpl* 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
254void ContextImpl::init_proto(maajs::ObjectType proto, maajs::FunctionType)
255{

Callers

nothing calls this directly

Calls 2

Utf8ValueMethod · 0.80
LengthMethod · 0.45

Tested by

no test coverage detected