script::dom::bindings::conversions

Function native_from_handlevalue

Source
pub(crate) unsafe fn native_from_handlevalue<T>(
    v: Handle<'_, Value>,
    cx: *mut JSContext,
) -> Result<*const T, ()>
Expand description

Get a *const T for a DOM object accessible from a HandleValue. Caller is responsible for throwing a JS exception if needed in case of error.

§Safety

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