Bug 1011109 - Don't allow Rooted<nsXBLMaybeCompiled<T>> to compile r=sfink
authorJon Coppeard <jcoppeard@mozilla.com>
Fri, 16 May 2014 10:00:44 +0100
changeset 183498 8475dbade7b3cb2f748e4deada61710325c28001
parent 183497 67f5286dda31cd67d55396c5973c46d301049910
child 183499 e5b1060172bea7860ca6cc040159cadf57d218d8
push idunknown
push userunknown
push dateunknown
reviewerssfink
bugs1011109
milestone32.0a1
Bug 1011109 - Don't allow Rooted<nsXBLMaybeCompiled<T>> to compile r=sfink
dom/xbl/nsXBLMaybeCompiled.h
--- a/dom/xbl/nsXBLMaybeCompiled.h
+++ b/dom/xbl/nsXBLMaybeCompiled.h
@@ -77,22 +77,27 @@ private:
 
   friend class js::GCMethods<nsXBLMaybeCompiled<UncompiledT> >;
 };
 
 /* Add support for JS::Heap<nsXBLMaybeCompiled>. */
 namespace js {
 
 template <class UncompiledT>
-struct GCMethods<nsXBLMaybeCompiled<UncompiledT> > : public GCMethods<JSObject *>
+struct GCMethods<nsXBLMaybeCompiled<UncompiledT> >
 {
   typedef struct GCMethods<JSObject *> Base;
 
   static nsXBLMaybeCompiled<UncompiledT> initial() { return nsXBLMaybeCompiled<UncompiledT>(); }
 
+  /*
+   * No implementation of kind() is provided to prevent
+   * Root<nsXBLMaybeCompiled<UncompiledT>> from being used.
+   */
+
   static bool poisoned(nsXBLMaybeCompiled<UncompiledT> function)
   {
     return function.IsCompiled() && Base::poisoned(function.GetJSFunction());
   }
 
   static bool needsPostBarrier(nsXBLMaybeCompiled<UncompiledT> function)
   {
     return function.IsCompiled() && Base::needsPostBarrier(function.GetJSFunction());