pub fn delete(&self, heap: &mut Heap) -> Result<(), Exception> {
        match self {
            Interpreted::Member { of, name } => {
                let object = heap.get_mut(*of);
                let configurable = match object.properties.get(name) {
                    Some(p) => p.access.configurable(),
                    None => return Ok(()),
                };
                if configurable {
                    object.properties.remove(name);
                    Ok(())
                } else {
                    let what = Interpreted::from(*of);
                    Err(Exception::TypeErrorNotConfigurable(what, name.to_string()))
                }
            }
            _ => Ok(()),
        }
    }
/// Corresponds to Javascript `delete` operator and all its weirdness.
/// `Ok`/`Err` correspond to `true`/`false` from `delete`.
/// <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/delete>
Corresponds to Javascript `delete` operator and all its weirdness.
Corresponds to Javascript ` delete ` operator and all its weirdness .
pub fn delete(&self, heap: &mut Heap) -> Result<(), Exception> {
        match self {
            Interpreted::Member { of, name } => {
                let object = heap.get_mut(*of);
                let configurable = match object.properties.get(name) {
                    Some(p) => p.access.configurable(),
                    None => return Ok(()),
                };
                if configurable {
                    object.properties.remove(name);
                    Ok(())
                } else {
                    let what = Interpreted::from(*of);
                    Err(Exception::TypeErrorNotConfigurable(what, name.to_string()))
                }
            }
            _ => Ok(()),
        }
    }
pub fn delete ( & self , heap : & mut Heap ) -> Result < ( ) , Exception > { match self { Interpreted :: Member { of , name } => { let object = heap . get_mut ( * of ) ; let configurable = match object . properties . get ( name ) { Some ( p ) => p . access . configurable ( ) , None => return Ok ( ( ) ) , } ; if configurable { object . properties . remove ( name ) ; Ok ( ( ) ) } else { let what = Interpreted :: from ( * of ) ; Err ( Exception :: TypeErrorNotConfigurable ( what , name . to_string ( ) ) ) } } _ => Ok ( ( ) ) , } }
Corresponds to Javascript `delete` operator and all its weirdness.
Corresponds to Javascript ` delete ` operator and all its weirdness .
&self
heap
&mut Heap
&self
heap
&mut Heap