diff --git a/dom/workers/RuntimeService.cpp b/dom/workers/RuntimeService.cpp index 6a54da289afe..02677b50cb64 100644 --- a/dom/workers/RuntimeService.cpp +++ b/dom/workers/RuntimeService.cpp @@ -843,6 +843,16 @@ CreateJSContextForWorker(WorkerPrivate* aWorkerPrivate, JSRuntime* aRuntime) return workerCx; } +static bool +PreserveWrapper(JSContext *cx, JSObject *obj) +{ + MOZ_ASSERT(cx); + MOZ_ASSERT(obj); + MOZ_ASSERT(mozilla::dom::IsDOMObject(obj)); + + return mozilla::dom::TryPreserveWrapper(obj); +} + class WorkerJSRuntime : public mozilla::CycleCollectedJSRuntime { public: @@ -854,6 +864,7 @@ public: WORKER_DEFAULT_NURSERY_SIZE), mWorkerPrivate(aWorkerPrivate) { + js::SetPreserveWrapperCallback(Runtime(), PreserveWrapper); JS_InitDestroyPrincipalsCallback(Runtime(), DestroyWorkerPrincipals); } diff --git a/dom/workers/test/943516.html b/dom/workers/test/943516.html new file mode 100644 index 000000000000..5f4667850f2f --- /dev/null +++ b/dom/workers/test/943516.html @@ -0,0 +1,10 @@ + + + diff --git a/dom/workers/test/crashtests.list b/dom/workers/test/crashtests.list new file mode 100644 index 000000000000..02d2e6251c01 --- /dev/null +++ b/dom/workers/test/crashtests.list @@ -0,0 +1 @@ +load 943516.html diff --git a/testing/crashtest/crashtests.list b/testing/crashtest/crashtests.list index 6b6a711a182b..47ec9fdb7639 100644 --- a/testing/crashtest/crashtests.list +++ b/testing/crashtest/crashtests.list @@ -26,6 +26,7 @@ include ../../dom/mathml/crashtests/crashtests.list include ../../dom/offline/crashtests/crashtests.list include ../../dom/plugins/test/crashtests/crashtests.list include ../../dom/smil/crashtests/crashtests.list +include ../../dom/workers/test/crashtests.list include ../../dom/xbl/crashtests/crashtests.list include ../../dom/xml/crashtests/crashtests.list include ../../dom/xslt/crashtests/crashtests.list