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

Function RegisterModule

Dependencies/napi/include/napi/napi-inl.h:252–259  ·  view source on GitHub ↗

Adapt the NAPI_MODULE registration function: - Wrap the arguments in NAPI wrappers. - Catch any NAPI errors and rethrow as JS exceptions.

Source from the content-addressed store, hash-verified

250// - Wrap the arguments in NAPI wrappers.
251// - Catch any NAPI errors and rethrow as JS exceptions.
252inline napi_value RegisterModule(napi_env env,
253 napi_value exports,
254 ModuleRegisterCallback registerCallback) {
255 return details::WrapCallback([&] {
256 return napi_value(registerCallback(Napi::Env(env),
257 Napi::Object(env, exports)));
258 });
259}
260
261////////////////////////////////////////////////////////////////////////////////
262// Env class

Callers

nothing calls this directly

Calls 4

WrapCallbackFunction · 0.85
napi_valueFunction · 0.85
EnvClass · 0.70
ObjectClass · 0.70

Tested by

no test coverage detected