MCPcopy Create free account
hub / github.com/BabylonJS/BabylonNative / CallbackStruct

Class CallbackStruct

Dependencies/napi/source/js_native_api_chakra.cc:80–94  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78 CHECK_JSRT_ERROR_CODE(JsGetProperty(global, promiseConstructorId, &promiseConstructor));
79
80 struct CallbackStruct {
81 static JsValueRef CALLBACK Callback(JsValueRef callee, bool isConstructCall, JsValueRef* arguments, unsigned short argumentCount, void* callbackState) {
82 return (reinterpret_cast<CallbackStruct*>(callbackState))->Callback(callee, isConstructCall, arguments, argumentCount);
83 }
84
85 JsValueRef Callback(JsValueRef callee, bool isConstructCall, JsValueRef* arguments, unsigned short argumentCount) {
86 *resolve = arguments[1];
87 *reject = arguments[2];
88
89 return JS_INVALID_REFERENCE;
90 }
91
92 JsValueRef* resolve{};
93 JsValueRef* reject{};
94 } cbs{ resolve, reject };
95
96 JsValueRef callbackFunction{};
97 CHECK_JSRT_ERROR_CODE(JsCreateFunction(&CallbackStruct::Callback, &cbs, &callbackFunction));

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected