Bug 1011109 - Don't allow Rooted<nsXBLMaybeCompiled<T>> to compile r=sfink

This commit is contained in:
Jon Coppeard 2014-05-16 10:00:44 +01:00
parent 6405c34d6e
commit 5b4809e885

View File

@ -82,12 +82,17 @@ private:
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());