fn walk(
        reviver: &JsValue,
        context: &mut Context,
        holder: &mut JsValue,
        key: &PropertyKey,
    ) -> JsResult<JsValue> {
        let value = holder.get_field(key.clone(), context)?;

        if let JsValue::Object(ref object) = value {
            let keys: Vec<_> = object.borrow().properties().keys().collect();

            for key in keys {
                let v = Self::walk(reviver, context, &mut value.clone(), &key);
                match v {
                    Ok(v) if !v.is_undefined() => {
                        value.set_field(key, v, false, context)?;
                    }
                    Ok(_) => {
                        value.remove_property(key);
                    }
                    Err(_v) => {}
                }
            }
        }
        context.call(reviver, holder, &[key.into(), value])
    }
/// This is a translation of the [Polyfill implementation][polyfill]
///
/// This function recursively walks the structure, passing each key-value pair to the reviver function
/// for possible transformation.
///
/// [polyfill]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse
This is a translation of the [Polyfill implementation][polyfill]
This function recursively walks the structure, passing each key-value pair to the reviver function
for possible transformation.


This is a translation of the [ Polyfill implementation ] [ polyfill ] This function recursively walks the structure passing each key - value pair to the reviver function for possible transformation .
fn walk(
        reviver: &JsValue,
        context: &mut Context,
        holder: &mut JsValue,
        key: &PropertyKey,
    ) -> JsResult<JsValue> {
        let value = holder.get_field(key.clone(), context)?;
        if let JsValue::Object(ref object) = value {
            let keys: Vec<_> = object.borrow().properties().keys().collect();
            for key in keys {
                let v = Self::walk(reviver, context, &mut value.clone(), &key);
                match v {
                    Ok(v) if !v.is_undefined() => {
                        value.set_field(key, v, false, context)?;
                    }
                    Ok(_) => {
                        value.remove_property(key);
                    }
                    Err(_v) => {}
                }
            }
        }
        context.call(reviver, holder, &[key.into(), value])
    }
fn walk ( reviver : & JsValue , context : & mut Context , holder : & mut JsValue , key : & PropertyKey , ) -> JsResult < JsValue > { let value = holder . get_field ( key . clone ( ) , context ) ? ; if let JsValue :: Object ( ref object ) = value { let keys : Vec < _ > = object . borrow ( ) . properties ( ) . keys ( ) . collect ( ) ; for key in keys { let v = Self :: walk ( reviver , context , & mut value . clone ( ) , & key ) ; match v { Ok ( v ) if ! v . is_undefined ( ) => { value . set_field ( key , v , false , context ) ? ; } Ok ( _ ) => { value . remove_property ( key ) ; } Err ( _v ) => { } } } } context . call ( reviver , holder , & [ key . into ( ) , value ] ) }
This is a translation of the [Polyfill implementation][polyfill]
This function recursively walks the structure, passing each key-value pair to the reviver function
for possible transformation.
This is a translation of the [ Polyfill implementation ] [ polyfill ] This function recursively walks the structure passing each key - value pair to the reviver function for possible transformation .
reviver
&JsValue
context
&mut Context
holder
&mut JsValue
key
&PropertyKey
reviver
&JsValue
context
&mut Context
holder
&mut JsValue
key
&PropertyKey