pub fn clone<'a, C: Context<'a>>(&self, cx: &mut C) -> Self {
        let env = cx.env();
        let internal = self.as_napi_ref().0 as *mut _;

        unsafe {
            reference::reference(env.to_raw(), internal);
        };

        Self {
            internal: self.internal.clone(),
            #[cfg(feature = "napi-6")]
            drop_queue: Arc::clone(&self.drop_queue),
            _phantom: PhantomData,
        }
    }
/// Clone a reference to the contained JavaScript object. This method can
/// be considered identical to the following:
/// ```
/// # use neon::prelude::*;
/// # fn my_neon_function(mut cx: FunctionContext) -> JsResult<JsUndefined> {
/// # let root = cx.argument::<JsObject>(0)?.root(&mut cx);
/// let inner = root.into_inner(&mut cx);
/// let cloned = inner.root(&mut cx);
/// let root = inner.root(&mut cx);
/// # Ok(cx.undefined())
/// # }
/// ```
Clone a reference to the contained JavaScript object. This method can
be considered identical to the following:
```
Clone a reference to the contained JavaScript object . This method can be considered identical to the following : ` ` `
pub fn clone<'a, C: Context<'a>>(&self, cx: &mut C) -> Self {
        let env = cx.env();
        let internal = self.as_napi_ref().0 as *mut _;
        unsafe {
            reference::reference(env.to_raw(), internal);
        };
        Self {
            internal: self.internal.clone(),
            #[cfg(feature = "napi-6")]
            drop_queue: Arc::clone(&self.drop_queue),
            _phantom: PhantomData,
        }
    }
pub fn clone < ' a , C : Context < ' a > > ( & self , cx : & mut C ) -> Self { let env = cx . env ( ) ; let internal = self . as_napi_ref ( ) . 0 as * mut _ ; unsafe { reference :: reference ( env . to_raw ( ) , internal ) ; } ; Self { internal : self . internal . clone ( ) , # [ cfg ( feature " " ) ] drop_queue : Arc :: clone ( & self . drop_queue ) , _phantom : PhantomData , } }
Clone a reference to the contained JavaScript object.
Clone a reference to the contained JavaScript object .
&self
cx
&mut C
use neon::prelude::*;
None
fn my_neon_function(mut cx: functioncontext) -> jsresult<jsundefined> {
None
let root = cx.argument::<jsobject>(0)?.root(&mut cx);
let inner = root.into_inner(&mut cx);
let cloned = inner.root(&mut cx);
let root = inner.root(&mut cx).
let inner = root . into_inner ( &mut cx ) ; let cloned = inner . root ( &mut cx ) ; let root = inner . root ( &mut cx ) .
ok(cx.undefined())
None
}
None