Bug 1315885 - Part 2: Avoid rethrowing exception in CustomElementCallback::Call. r=wchen
authorJohn Dai <jdai@mozilla.com>
Tue, 11 Jul 2017 02:52:00 -0400
changeset 418405 60f70ae7c82df8329d4cc9bacb31bb5762d46f80
parent 418404 4120a7d9f16c9708805cdf69146a7573f7d3c212
child 418406 7366a7028d98b508a130687dfd6e1cc1d0a360d0
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerswchen
bugs1315885
milestone56.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 1315885 - Part 2: Avoid rethrowing exception in CustomElementCallback::Call. r=wchen
dom/base/CustomElementRegistry.cpp
--- a/dom/base/CustomElementRegistry.cpp
+++ b/dom/base/CustomElementRegistry.cpp
@@ -50,16 +50,20 @@ CustomElementCallback::Call()
     case nsIDocument::eDetached:
       static_cast<LifecycleDetachedCallback *>(mCallback.get())->Call(mThisObject, rv);
       break;
     case nsIDocument::eAttributeChanged:
       static_cast<LifecycleAttributeChangedCallback *>(mCallback.get())->Call(mThisObject,
         mArgs.name, mArgs.oldValue, mArgs.newValue, rv);
       break;
   }
+
+  // If callbacks throw exceptions, it'll be handled and reported in
+  // Lifecycle*Callback::Call function.
+  rv.SuppressException();
 }
 
 void
 CustomElementCallback::Traverse(nsCycleCollectionTraversalCallback& aCb) const
 {
   NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(aCb, "mThisObject");
   aCb.NoteXPCOMChild(mThisObject);