Skip to main content

JS_AddModuleExport

Function JS_AddModuleExport 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn JS_AddModuleExport( _ctx: *mut JsContext, m: *mut JsModuleDef, export_name: *const c_char, ) -> c_int
Expand description

JS_AddModuleExport: declare a name this module will export.

A declaration without a value leaves the export undefined, which is what the reference does and what makes an init function that forgets a name visible rather than a hard error.

ยงSafety

m must come from JS_NewCModule, and export_name must be NUL-terminated.