Function mozjs::rust::define_properties

source ·
pub unsafe fn define_properties(
    cx: *mut JSContext,
    obj: HandleObject<'_>,
    properties: &'static [JSPropertySpec],
) -> Result<(), ()>
Expand description

Defines attributes on obj. The last entry of properties must contain zeroed memory.

§Failures

Returns Err on JSAPI failure.

§Panics

Panics if the last entry of properties does not contain zeroed memory.

§Safety

  • cx must be valid.
  • This function calls into unaudited C++ code.