chore(napi): make napi_register_module_v1 pub (#1747)

* feat(napi): make napi_register_module_v1 pub

* docs: add safety section

* chore: format doc comment
This commit is contained in:
Markus 2023-10-09 05:18:34 +02:00 committed by GitHub
parent 0dd6422abf
commit 9b4beb83e9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -350,7 +350,14 @@ unsafe extern "C" fn napi_register_wasm_v1(
#[cfg(not(feature = "noop"))] #[cfg(not(feature = "noop"))]
#[no_mangle] #[no_mangle]
unsafe extern "C" fn napi_register_module_v1( /// Register the n-api module exports.
///
/// # Safety
/// This method is meant to be called by Node.js while importing the n-api module.
/// Only call this method if the current module is **not** imported by a node-like runtime.
///
/// Arguments `env` and `exports` must **not** be null.
pub unsafe extern "C" fn napi_register_module_v1(
env: sys::napi_env, env: sys::napi_env,
exports: sys::napi_value, exports: sys::napi_value,
) -> sys::napi_value { ) -> sys::napi_value {