Bug 1153636: Don't assert with addEventListener("") on workers. r=smaug
authorKyle Huey <khuey@kylehuey.com>
Wed, 06 Jan 2016 13:18:29 -0800
changeset 278869 bea110e17c0bb189504274c24ef9de94316bd0c6
parent 278868 d33b8f5dfd87dd0f5c1050d8772eb0ad6400efba
child 278870 aadea6a5781c963f782fa3bd4c7c046c8ff658e8
push id29860
push usercbook@mozilla.com
push dateThu, 07 Jan 2016 10:51:20 +0000
treeherdermozilla-central@e0bcd16e1d4b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1153636
milestone46.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1153636: Don't assert with addEventListener("") on workers. r=smaug
dom/events/EventListenerManager.cpp
dom/workers/test/crashtests/1153636.html
dom/workers/test/crashtests/crashtests.list
--- a/dom/events/EventListenerManager.cpp
+++ b/dom/events/EventListenerManager.cpp
@@ -228,17 +228,17 @@ EventListenerManager::AddEventListenerIn
                         const nsAString& aTypeString,
                         const EventListenerFlags& aFlags,
                         bool aHandler,
                         bool aAllEvents)
 {
   MOZ_ASSERT(// Main thread
              (NS_IsMainThread() && aEventMessage && aTypeAtom) ||
              // non-main-thread
-             (!NS_IsMainThread() && aEventMessage && !aTypeString.IsEmpty()) ||
+             (!NS_IsMainThread() && aEventMessage) ||
              aAllEvents, "Missing type"); // all-events listener
 
   if (!aListenerHolder || mClearingListeners) {
     return;
   }
 
   // Since there is no public API to call us with an EventListenerHolder, we
   // know that there's an EventListenerHolder on the stack holding a strong ref
new file mode 100644
--- /dev/null
+++ b/dom/workers/test/crashtests/1153636.html
@@ -0,0 +1,5 @@
+<script>
+
+new Worker("data:text/javascript;charset=UTF-8,self.addEventListener('',function(){},false);");
+
+</script>
--- a/dom/workers/test/crashtests/crashtests.list
+++ b/dom/workers/test/crashtests/crashtests.list
@@ -1,3 +1,4 @@
 load 779707.html
 load 943516.html
+load 1153636.html
 load 1158031.html