MCPcopy Create free account
hub / github.com/LibreSprite/LibreSprite / makeLocal

Method makeLocal

src/script/v8/engine.cpp:299–311  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

297 }
298
299 v8::Local<v8::Object> makeLocal() {
300 auto isolate = m_engine.get<V8Engine>()->m_isolate;
301 if (!m_local.IsEmpty())
302 return m_local.Get(isolate);
303 auto local = v8::Object::New(isolate);
304 pushFunctions(local);
305 pushProperties(local);
306 m_local.Reset(isolate, local);
307 m_local.SetWeak(this, [](const auto& info) {
308 reinterpret_cast<V8ScriptObject*>(info.GetParameter())->release();
309 }, v8::WeakCallbackType::kParameter);
310 return local;
311 }
312
313 void release() {
314 m_local.ClearWeak();

Callers 1

returnValueFunction · 0.45

Calls 1

releaseMethod · 0.45

Tested by

no test coverage detected