pub fn to_ref(&self) -> Result<JSRef, Exception> {
        match self {
            JSValue::Ref(objref) => Ok(*objref),
            _ => {
                let what = Interpreted::Value(self.clone());
                Err(Exception::ReferenceNotAnObject(what))
            }
        }
    }
/// to_ref() tries to return the underlying object reference, if any.
/// It's useful for checking if a value points to an object.
to_ref() tries to return the underlying object reference, if any.
It's useful for checking if a value points to an object.
to_ref () tries to return the underlying object reference if any . It ' s useful for checking if a value points to an object .
pub fn to_ref(&self) -> Result<JSRef, Exception> {
        match self {
            JSValue::Ref(objref) => Ok(*objref),
            _ => {
                let what = Interpreted::Value(self.clone());
                Err(Exception::ReferenceNotAnObject(what))
            }
        }
    }
pub fn to_ref ( & self ) -> Result < JSRef , Exception > { match self { JSValue :: Ref ( objref ) => Ok ( * objref ) , _ => { let what = Interpreted :: Value ( self . clone ( ) ) ; Err ( Exception :: ReferenceNotAnObject ( what ) ) } } }
to_ref() tries to return the underlying object reference, if any.
to_ref () tries to return the underlying object reference if any .
&self
&self