Function script::dom::bindings::utils::find_enum_value

source ยท
pub unsafe fn find_enum_value<'a, T>(
    cx: *mut JSContext,
    v: HandleValue<'_>,
    pairs: &'a [(&'static str, T)],
) -> Result<(Option<&'a T>, DOMString), ()>
Expand description

Find the enum equivelent of a string given by v in pairs. Returns Err(()) on JSAPI failure (there is a pending exception), and Ok((None, value)) if there was no matching string.