Adapt the NAPI_MODULE registration function: - Wrap the arguments in NAPI wrappers. - Catch any NAPI errors and rethrow as JS exceptions.
| 551 | // - Wrap the arguments in NAPI wrappers. |
| 552 | // - Catch any NAPI errors and rethrow as JS exceptions. |
| 553 | inline napi_value RegisterModule(napi_env env, |
| 554 | napi_value exports, |
| 555 | ModuleRegisterCallback registerCallback) { |
| 556 | return details::WrapCallback(env, [&] { |
| 557 | return napi_value( |
| 558 | registerCallback(Napi::Env(env), Napi::Object(env, exports))); |
| 559 | }); |
| 560 | } |
| 561 | |
| 562 | //////////////////////////////////////////////////////////////////////////////// |
| 563 | // Maybe class |
nothing calls this directly
no test coverage detected