Function mozjs::jsapi::JS::NewFunctionFromSpec
source ยท pub unsafe extern "C" fn NewFunctionFromSpec(
cx: *mut JSContext,
fs: *const JSFunctionSpec,
id: Handle<PropertyKey>,
) -> *mut JSFunction
Expand description
Create a new function based on the given JSFunctionSpec, *fs.
id is the result of a successful call to
PropertySpecNameToId(cx, fs->name, &id)
or
PropertySpecNameToPermanentId(cx, fs->name, &id)
.
Unlike JS_DefineFunctions, this does not treat fs as an array. *fs must not be JS_FS_END.