diff --git a/dom/src/threads/nsDOMThreadService.cpp b/dom/src/threads/nsDOMThreadService.cpp index 47a5394e9b6..58f091211f4 100644 --- a/dom/src/threads/nsDOMThreadService.cpp +++ b/dom/src/threads/nsDOMThreadService.cpp @@ -320,7 +320,7 @@ public: // Make sure we have a JSContext to run everything on. JSContext* cx = (JSContext*)PR_GetThreadPrivate(gJSContextIndex); NS_ASSERTION(cx, "nsDOMThreadService didn't give us a context!"); - + JS_SetContextPrivate(cx, mWorker); // Tell the worker which context it will be using @@ -347,6 +347,9 @@ public: protected: void RunQueue() { + JSContext* cx = (JSContext*)PR_GetThreadPrivate(gJSContextIndex); + NS_ASSERTION(cx, "nsDOMThreadService didn't give us a context!"); + while (1) { nsCOMPtr runnable; { @@ -367,6 +370,9 @@ protected: } } + // Clear out any old cruft hanging around in the regexp statics. + JS_ClearRegExpStatics(cx); + #ifdef DEBUG nsresult rv = #endif diff --git a/dom/src/threads/nsDOMWorkerSecurityManager.cpp b/dom/src/threads/nsDOMWorkerSecurityManager.cpp index b94973abb4f..e14540cf428 100644 --- a/dom/src/threads/nsDOMWorkerSecurityManager.cpp +++ b/dom/src/threads/nsDOMWorkerSecurityManager.cpp @@ -89,14 +89,16 @@ NS_IMETHODIMP nsDOMWorkerSecurityManager::CanCreateInstance(JSContext* aJSContext, const nsCID& aCID) { - return NS_OK; + NS_NOTREACHED("Should not call this!"); + return NS_ERROR_UNEXPECTED; } NS_IMETHODIMP nsDOMWorkerSecurityManager::CanGetService(JSContext* aJSContext, const nsCID& aCID) { - return NS_OK; + NS_NOTREACHED("Should not call this!"); + return NS_ERROR_UNEXPECTED; } NS_IMETHODIMP diff --git a/dom/src/threads/test/Makefile.in b/dom/src/threads/test/Makefile.in index eca731da43e..c1db91fa44a 100644 --- a/dom/src/threads/test/Makefile.in +++ b/dom/src/threads/test/Makefile.in @@ -57,6 +57,8 @@ _TEST_FILES = \ test_threadErrors.html \ test_threadTimeouts.html \ test_longThread.html \ + test_recursion.html \ + test_regExpStatics.html \ test_xhr.html \ testXHR.txt \ $(NULL)