#[unsafe(no_mangle)]pub unsafe extern "C" fn JS_DefineProperty(
ctx: *mut JsContext,
this_obj: JsValue,
prop: Atom,
val: JsValue,
getter: JsValue,
setter: JsValue,
flags: c_int,
) -> c_intExpand description
JS_DefineProperty: define an accessor and/or a value in one call.
Only the fields the flags say are present are used, which is what lets a caller change a property’s attributes without touching what it holds.
§Safety
this_obj must be live; val, getter and setter are read, and the ones the flags
name are consumed.