script_bindings::utils

Function set_dictionary_property

Source
pub(crate) unsafe fn set_dictionary_property(
    cx: *mut JSContext,
    object: HandleObject<'_>,
    property: &str,
    value: HandleValue<'_>,
) -> Result<(), ()>
Expand description

Set the property with name property from object. Returns Err(()) on JSAPI failure, or null object, and Ok(()) otherwise

§Safety

cx must point to a valid, non-null JSContext.