diff --git a/dom/base/Makefile.in b/dom/base/Makefile.in index 0b5b19c459ce..8a8a12bf7655 100644 --- a/dom/base/Makefile.in +++ b/dom/base/Makefile.in @@ -125,6 +125,10 @@ endif include $(topsrcdir)/config/rules.mk +LOCAL_INCLUDES += \ + -I$(srcdir)/../../js/src/xpconnect/wrappers \ + $(NULL) + ifdef MOZ_X11 CXXFLAGS += $(TK_CFLAGS) LDFLAGS += $(TK_LIBS) diff --git a/dom/base/nsJSEnvironment.cpp b/dom/base/nsJSEnvironment.cpp index c4496665672e..9a58788aa93f 100644 --- a/dom/base/nsJSEnvironment.cpp +++ b/dom/base/nsJSEnvironment.cpp @@ -102,6 +102,7 @@ #include "nsITimelineService.h" #include "nsDOMScriptObjectHolder.h" #include "prmem.h" +#include "WrapperFactory.h" #include "nsGlobalWindow.h" #ifdef MOZ_JSDEBUGGER @@ -3386,6 +3387,9 @@ nsJSContext::ClearScope(void *aGlobalObj, PRBool aClearFromProtoChain) ac.enterAndIgnoreErrors(mContext, obj); JS_ClearScope(mContext, obj); + if (xpc::WrapperFactory::IsXrayWrapper(obj)) { + JS_ClearScope(mContext, &obj->getProxyExtra().toObject()); + } if (!obj->getParent()) { JS_ClearRegExpStatics(mContext, obj); }