pub fn boolify(&self, heap: &Heap) -> bool {
        match self {
            JSValue::Undefined => false,
            JSValue::String(s) => s.len() > 0,
            JSValue::Ref(Heap::NULL) => false,
            JSValue::Ref(_) => true,
            _ => {
                if let Some(n) = self.numberify(heap) {
                    !(n == 0.0 || f64::is_nan(n))
                } else {
                    true
                }
            }
        }
    }
/// boolify() treats everythings as a truthy value.
/// ES5: ToBoolean
boolify() treats everythings as a truthy value.
boolify () treats everythings as a truthy value .
pub fn boolify(&self, heap: &Heap) -> bool {
        match self {
            JSValue::Undefined => false,
            JSValue::String(s) => s.len() > 0,
            JSValue::Ref(Heap::NULL) => false,
            JSValue::Ref(_) => true,
            _ => {
                if let Some(n) = self.numberify(heap) {
                    !(n == 0.0 || f64::is_nan(n))
                } else {
                    true
                }
            }
        }
    }
pub fn boolify ( & self , heap : & Heap ) -> bool { match self { JSValue :: Undefined => false , JSValue :: String ( s ) => s . len ( ) > 0 , JSValue :: Ref ( Heap :: NULL ) => false , JSValue :: Ref ( _ ) => true , _ => { if let Some ( n ) = self . numberify ( heap ) { ! ( n == 0.0 || f64 :: is_nan ( n ) ) } else { true } } } }
boolify() treats everythings as a truthy value.
boolify () treats everythings as a truthy value .
&self
heap
&Heap
&self
heap
&Heap