Bug 877760 - XPConnect always logs an error when a component doesn't implement a method. r=mrbkap
authorGabor Krizsanits <gkrizsanits@mozilla.com>
Tue, 11 Jun 2013 12:01:33 +0200
changeset 134611 d8425335f52f560ae2858f8c76e389084d06efe8
parent 134610 407dd32db3b07ac5bd35113dc785418357e481a4
child 134612 1ac9367a6c23dcac1c14469eb18b79badf2017d1
push id29297
push usergkrizsanits@mozilla.com
push dateTue, 11 Jun 2013 10:02:47 +0000
treeherdermozilla-inbound@d8425335f52f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmrbkap
bugs877760
milestone24.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 877760 - XPConnect always logs an error when a component doesn't implement a method. r=mrbkap
js/xpconnect/src/XPCWrappedJSClass.cpp
--- a/js/xpconnect/src/XPCWrappedJSClass.cpp
+++ b/js/xpconnect/src/XPCWrappedJSClass.cpp
@@ -1007,16 +1007,21 @@ nsXPCWrappedJSClass::CheckForException(X
                 // exceptional and shouldn't be reported. We have to do this
                 // check here instead of in xpcwrappedjs (like we do for QI) to
                 // avoid adding extra code to all xpcwrappedjs objects.
                 if (reportable && e_result == NS_ERROR_NO_INTERFACE &&
                     !strcmp(anInterfaceName, "nsIInterfaceRequestor") &&
                     !strcmp(aPropertyName, "getInterface")) {
                     reportable = false;
                 }
+
+                // More special case, see bug 877760.
+                if (e_result == NS_ERROR_XPC_JSOBJECT_HAS_NO_FUNCTION_NAMED) {
+                    reportable = false;
+                }
             }
 
             // Try to use the error reporter set on the context to handle this
             // error if it came from a JS exception.
             if (reportable && is_js_exception &&
                 JS_GetErrorReporter(cx) != xpcWrappedJSErrorReporter) {
                 reportable = !JS_ReportPendingException(cx);
             }