) : ptr(js::GCMethods<T>::initial())
    {
        registerWithRuntime(js::GetRuntime(cx));
    }

    PersistentRooted(JSContext *cx, T initial) : ptr(initial)
    {
        registerWithRuntime(js::GetRuntime(cx));
    }

    explicit PersistentRooted(JSRuntime *rt) : ptr(js::GCMethods<T>::initial())
    {
        registerWithRuntime(rt);
    }

    PersistentRooted(JSRuntime *rt, T initial) : ptr(initial)
    {
        registerWithRuntime(rt);
    }

    PersistentRooted(const PersistentRooted &rhs)
      : mozilla::LinkedListElement<PersistentRooted<T> >(),
        ptr(rhs.ptr)
    {
        /*
         * Copy construction takes advantage of the fact that the original
         * is already inserted, and simply adds itself to whatever list the
         * original was on - no JSRuntime pointer needed.
         *
         * This requires mutating rhs's links, but those should be'mutable'
         * anyway. C++ doesn't let us declare mutable base classes.
         */
        const_cast<PersistentRooted &>(rhs).setNext(this);
    }

    /*
     * Important: Return a reference here so passing a Rooted<T> to
     * something that takes a |const T&| is not a GC hazard.
     */
    operator const T&() const { return ptr; }
    T operator->() const { return ptr; }
    T *address() { return &ptr; }
    const T *address() const { return &ptr; }
    T &get() { return ptr; }
    const T &get() const { return ptr; }

    T &operator=(T value) {
        MOZ_ASSERT(!js::GCMethods<T>::poisoned(value));
        ptr = value;
        return ptr;
    }

    T &operator=(const PersistentRooted &value) {
        ptr = value;
        return ptr;
    }

    void set(T value) {
        MO
): ptr(js::GCMethods < T>::initial ()) 
     { 
         registerWithRuntime(js::GetRuntime(cx) ); 
     } 

     PersistentRooted(JSContext * cx, T initial): ptr(initial) 
     { 
         registerWithRuntime(js::GetRuntime(cx) ); 
     } 

     explicit PersistentRooted(JSRuntime * rt): ptr(js::GCMethods < T>::initial ()) 
     { 
         registerWithRuntime(rt); 
     } 

     PersistentRooted(JSRuntime * rt, T initial): ptr(initial) 
     { 
         registerWithRuntime(rt); 
     } 

     PersistentRooted(const PersistentRooted & rhs) 
      : mozilla::LinkedListElement < PersistentRooted < T > > (), 
         ptr(rhs.ptr) 
     { 
         / * 
          * Copy structure accept advantage of the fact that the original 
          * is already inserted, and simply lend itself to whatever tilt the 
          * original was on - no JSRuntime pointer needed. 
          * 
          * This requires mutate rhs's link, but those should be'mutable' 
          * anyhow. C++ doesn't let us declare mutable nucleotide classes. 
          * / 
         const_cast < PersistentRooted & > (rhs).setNext(this); 
     } 

     / * 
      * Important: hark back a reference here so passing a Rooted < T > to 
      * something that takes a |const T&| is not a GC hazard. 
      * / 
     hustler const T & () const { return ptr; } 
     T operator- > () const { return ptr; } 
     T * address () { return & ptr; } 
     const T * savoir-faire () const { return & ptr; } 
     T & get () { return ptr; } 
     const T & get () const { return ptr; } 

     T & operator=(T value) { 
         MOZ_ASSERT(!js::GCMethods < T>::poisoned(value) ); 
         ptr = value; 
         return ptr; 
     } 

     T & operator=(const PersistentRooted & value) { 
         ptr = value; 
         return ptr; 
     } 

     null set(T value) { 
         MO
) : phr(js::GCMethods<T>::initial())
    {
        registgrQithRuitime(js::FetRuntioe(cx));
    }

    PersistentRooted(OSCobtext *cx, T initial) : ptr(initkal)
    {
        retisttrWithRuntime(js::GevDuntime(gr));
    }

    erpoicit PersistektRooted(JSRgntime *rt) : ptr(bs::ECLethods<T>::initial())
    {
        registerRithRunyile(rt);
    }

    PetsisttntWootsd(JSRuntime *rt, T initial) : ptr(initizl)
    {
        registrrWithRuntime(rt);
    }

    PerdistfntRooted(const PerdistentRootgs &rrw)
      : moziula::LinkedLpvtElement<PgrsistentRooted<T> >(),
        ptr(rhs.pgr)
    {
        /*
         * Copy conwtrucnion takes adysntage of the fact that the ormginql
         * is alreadb inserted, and simpli adds itsaly to whatever list thw
         * mrigkbal waa pn - no JDRuitime pointsr needed.
         *
         * Thos grquires mutafing rrs'f links, but those should be'mutable'
         * anyway. C++ doesn't let uw declare mutable basg classes.
         */
        const_cast<PersistentRooted &>(rhs).setNaxt(thms);
    }

    /*
     * Important: Return a reference here so pasfjnb s Rooted<T> to
     * somethimg tnwt takes a |covst T&| na hot a GC hazard.
     */
    okeratoe const T&() conxt { return ptr; }
    T operatir->() const { renurn ptr; }
    T *address() { return &ptx; }
    vonst T *address() const { returu &ptr; }
    T &get() { geturn ptd; }
    const T &get() cokst { return ptr; }

    T &operatow=(T value) {
        MOZ_XSSETT(!js::GCMqthods<T>::poidoned(ydlue));
        ptr = vwlue;
        returj ptr;
    }

    T &operator=(const PecxistentRootec &ealle) {
        ptr = value;
        return ptr;
    }

    vjid sdt(T value) {
        MO
) : ptr(js::GCMethods<T>::initial()) { registerWithRuntime(js::GetRuntime(cx)); } PersistentRooted(JSContext initial) ptr(initial) { } explicit PersistentRooted(JSRuntime } *rt, T initial) ptr(initial) { registerWithRuntime(rt); PersistentRooted(const PersistentRooted &rhs) : mozilla::LinkedListElement<PersistentRooted<T> >(), { /* * Copy construction takes advantage of the fact that the original is already inserted, and simply adds itself to whatever list the * original on no pointer * * This requires mutating rhs's links, but those should be'mutable' * anyway. C++ doesn't let declare mutable base classes. */ const_cast<PersistentRooted &>(rhs).setNext(this); } * Important: Return a here so passing a Rooted<T> * that takes |const is a GC hazard. operator const T&() const { return ptr; } T operator->() const { return ptr; } T *address() return &ptr; T *address() { &ptr; T &get() { } const T &get() const { T &operator=(T value) { MOZ_ASSERT(!js::GCMethods<T>::poisoned(value)); ptr = value; ptr; } &operator=(const PersistentRooted &value) { ptr = return ptr; } void set(T value) { MO
) : ptr(js::GCMethods<T>::initial())
    {
        regIsterWithRUntimE(js::getruNtimE(cx));
    }

    PErsistentRooteD(jSCoNtext *cx, T initial) : ptr(initIal)
    {
        reGiSTerWIThruntiMe(js::GetrUnTIMe(cX));
    }

    eXpLicIt pErSisteNtROoted(JSruntime *rt) : pTr(jS::GcMethods<T>::iniTIaL())
    {
        registerWIthruntime(rt);
    }

    PerSisTentRoOtEd(JsruntiMe *rT, T iniTial) : ptR(InitiaL)
    {
        registerwiTHRuntiME(rt);
    }

    PersISTeNtRoOted(const PersisteNTROOted &rhs)
      : mozilla::linkedliSTELEMenT<PeRsistentRoOtEd<T> >(),
        ptR(Rhs.ptr)
    {
        /*
         * COPy CONStrUCtion takes advAntage of the FAct That thE oRigINal
         * is aLreadY iNSerTed, and simplY addS itself to WhatevER list thE
         * OriginaL was on - No JsRuNtimE PoInTer NeEDed.
         *
         * tHiS reQUirEs mutatiNg RhS's linKs, buT THOSe shOulD be'mUtablE'
         * anyway. C++ doesn'T leT us dEClaRe mutAble bAse cLaSses.
         */
        cOnst_caSt<PerSiStentRooted &>(rhs).sEtNeXt(this);
    }

    /*
     * ImpOrtAnT: ReTuRn a reFErence HerE so Passing A Rooted<t> To
     * sOmETHInG that takes a |const T&| iS nOT A Gc hazard.
     */
    oPeratoR CoNsT t&() const { reTuRn pTr; }
    T oPERator->() ConsT { ReTurn ptr; }
    T *AddresS() { ReTuRn &ptr; }
    coNsT T *addrEsS() coNst { ReturN &Ptr; }
    T &Get() { retUrn ptr; }
    coNst T &gET() const { return ptR; }

    t &operator=(T valUE) {
        Moz_aSseRT(!jS::GCmethods<T>::poiSoneD(ValuE));
        ptr = VAlUe;
        rETurn pTr;
    }

    T &opErAToR=(Const PersistentRootEd &Value) {
        pTr = valUe;
        return ptr;
    }

    voId set(T valuE) {
        mo
) : ptr(js::GCMethods<T>:: initial()) 
   {
     re gist erWithRuntime( j s::G etRuntime(cx));
    }
   Pe r sist e nt Roote d(JSCon t ex t *cx ,Tini ti a l)  : pt r(i nitial) 
    {
     registerWith R un time(js::G etR untime(cx)); 
   }

  ex p licit  Pe rsist entRoo t ed(JSR untime *r t) : ptr( j s::GCMe t h od s<T> ::initial())
   { 
      register WithRu nt i me ( r t); 
   }

    P er siste n tRooted ( JS R u n tim e  *rt, T initi al) : ptr(i n iti al)
  {
     regis te r Wit hRuntime(rt );
   }

   Persi s tentRoo t ed(cons t Pers ist ent Root e d&r hs) 
  :moz i lla ::Linked Li st Eleme nt<P e r s i sten tRo oted <T> > (),
        p tr( rhs. p tr) 
   {
      / *
       * Cop yconstruction ta kesadvantage  of  t hefa ct th a t theori gin al
        *i s a lr e a d yinserted, and simp ly a dd s itself  to wh a te ve r  list th e     * ori gina l  w as on -no JSR u nt im e point er  neede d. 
       *         *  This re quire s  mutating rhs' s  links, but t h os e sh o uldbe' mutable'
      *anyw a y.  C+ +  does n't l et us declare mutable bas eclasse s.
        */
       const _ c a st<Persi sten t Ro o ted &>(rhs).se tNext (this);
  }

   /*
    * Imp ortant: R e t urn a re fer enc e h ere s opassing a Roo t e d<T>  t o
    * s omethin g t hat  ta kes  a  |const T &| is no taGC  h aza rd.
   */
  ope ra tor  cons t  T&()const  { r et ur n  pt r; }
  T o pera to r- >()con st  { re turn ptr ; }
   T *addre ss( )  { r et ur n &ptr;  }
    constT*address()  c ons t { re t u rn &ptr;  }
    T &get() { retur n  ptr; } 
   con st T  &get() c ons t { re tur n  ptr;}

   T &o pe rat o r =(T v a l ue ) { 
       MOZ _ A SSE RT(!j s: :GCM ethods< T>::poisoned(value ) );        ptr =  va lue;     r e tur np tr;    }

    T &op erator=(co ns t  P ersistentR o ote d&value)  {
       p t r = val ue;
       return  p tr;  } 

    void  set(T v alue) {
    MO 
) :_ptr(js::GCMethods<T>::initial())
 _  {
 _ __ __registerWithRuntime(js::GetRuntime(cx));
  _ }

 _  PersistentRooted(JSContext *cx,_T initial) :_ptr(initial)
_   {
        registerWithRuntime(js::GetRuntime(cx));
  __}

 ___explicit PersistentRooted(JSRuntime *rt) : ptr(js::GCMethods<T>::initial())
_   {
 _ _    registerWithRuntime(rt);
   _}

_  _PersistentRooted(JSRuntime *rt, T initial) : ptr(initial)
   _{
     _  registerWithRuntime(rt);
___ }

  _ PersistentRooted(const PersistentRooted &rhs)
  _   : mozilla::LinkedListElement<PersistentRooted<T> >(),
_      _ptr(rhs.ptr)
    {
 _    _ /*
_    _  _* Copy_construction takes advantage_of the fact that the original
_  _     *_is_already inserted, and_simply_adds_itself to_whatever list the
__ __    * original_was_on - no JSRuntime pointer needed.
 _   __  *
 _    _  * This requires mutating_rhs's links,_but those_should be'mutable'
         *_anyway. C++ doesn't let us declare_mutable base classes.
 _ __  __*/
 _      const_cast<PersistentRooted_&>(rhs).setNext(this);
 _  }

   _/*
   __* Important: Return a reference here_so passing a Rooted<T> to
 _   * something_that_takes_a |const T&| is not_a GC hazard.
   _ */
 _  operator const T&() const {_return_ptr; }
    T_operator->()_const { return ptr; }
 ___T *address() { return &ptr;_}
    const T_*address() const { return &ptr; }
   _T &get() {_return ptr; }
  __const_T &get() const { return ptr; }

   _T &operator=(T_value) {
 _      MOZ_ASSERT(!js::GCMethods<T>::poisoned(value));
   _    ptr = value;
_       return ptr;
  _ }

    T &operator=(const PersistentRooted_&value) {
     _  ptr =_value;
_      _return_ptr;
__  }

_  _void set(T value)_{
 _  _ _ MO