MCPcopy Create free account
hub / github.com/Tencent/puerts / GetFunctionFromResult

Function GetFunctionFromResult

unity/native_src/Src/Puerts.cpp:816–828  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

814}
815
816V8_EXPORT JSFunction *GetFunctionFromResult(FResultInfo *ResultInfo)
817{
818 v8::Isolate* Isolate = ResultInfo->Isolate;
819 v8::Isolate::Scope IsolateScope(Isolate);
820 v8::HandleScope HandleScope(Isolate);
821 v8::Local<v8::Context> Context = ResultInfo->Context.Get(Isolate);
822 v8::Context::Scope ContextScope(Context);
823 auto Result = ResultInfo->Result.Get(Isolate);
824
825 auto V8Function = v8::Local<v8::Function>::Cast(Result->ToObject(Context).ToLocalChecked());
826 auto JsEngine = FV8Utils::IsolateData<JSEngine>(Isolate);
827 return JsEngine->CreateJSFunction(Isolate, Context, V8Function);
828}
829
830V8_EXPORT void ResetResult(FResultInfo *ResultInfo)
831{

Callers

nothing calls this directly

Calls 5

CastFunction · 0.85
ToObjectMethod · 0.80
CreateJSFunctionMethod · 0.80
GetMethod · 0.45
ToLocalCheckedMethod · 0.45

Tested by

no test coverage detected