pub fn root_from_object<T>(
    obj: *mut JSObject,
    cx: *mut JSContext
) -> Result<Root<Dom<T>>, ()>where
    T: DomObject + IDLInterface,
Expand description

Get a DomRoot<T> for the given DOM object, unwrapping any wrapper around it first, and checking if the object is of the correct type.

Returns Err(()) if obj is an opaque security wrapper or if the object is not a reflector for a DOM object of the given type (as defined by the proto_id and proto_depth).