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

Method pushFunctions

src/script/v8/engine.cpp:269–279  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

267 }
268
269 void pushFunctions(v8::Local<v8::Object>& object) {
270 auto isolate = m_engine.get<V8Engine>()->m_isolate;
271 auto context = m_engine.get<V8Engine>()->context();
272 for (auto& entry : functions) {
273 auto tpl = v8::FunctionTemplate::New(isolate, callFunc, v8::External::New(isolate, &entry.second));
274 auto func = tpl->GetFunction(context).ToLocalChecked();
275 Check(object->Set(context,
276 ToLocal(v8::String::NewFromUtf8(isolate, entry.first.c_str())),
277 func));
278 }
279 }
280
281 void pushProperties(v8::Local<v8::Object>& object) {
282 auto& isolate = m_engine.get<V8Engine>()->m_isolate;

Callers

nothing calls this directly

Calls 3

CheckFunction · 0.85
ToLocalFunction · 0.85
contextMethod · 0.45

Tested by

no test coverage detected