Bug 893186, part 1 - Fix some code in xpconnect to use JS_HasProperty instead of JS_GetPropertyAttributes. r=bholley.
authorJason Orendorff <jorendorff@mozilla.com>
Fri, 06 Sep 2013 12:02:51 -0500
changeset 146006 2c19e0a8d53ea1429d59a8599065559764cc282a
parent 146005 3d72fcbf22a5d561844f1dd78a149bf18cf42c9b
child 146007 5a5583d59e3f440bb076cacd434e9693ba544f58
push id25233
push userryanvm@gmail.com
push dateSat, 07 Sep 2013 00:57:08 +0000
treeherdermozilla-central@3697f962bb7b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbholley
bugs893186
milestone26.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 893186, part 1 - Fix some code in xpconnect to use JS_HasProperty instead of JS_GetPropertyAttributes. r=bholley.
js/xpconnect/src/XPCConvert.cpp
--- a/js/xpconnect/src/XPCConvert.cpp
+++ b/js/xpconnect/src/XPCConvert.cpp
@@ -1165,24 +1165,23 @@ XPCConvert::JSValToXPCException(MutableH
                 JSString* str;
                 if (nullptr != (str = JS_ValueToString(cx, s)))
                     message.encodeLatin1(cx, str);
                 return JSErrorToXPCException(message.ptr(), ifaceName,
                                              methodName, report, exceptn);
             }
 
 
-            unsigned ignored;
             bool found;
 
             // heuristic to see if it might be usable as an xpcexception
-            if (!JS_GetPropertyAttributes(cx, obj, "message", &ignored, &found))
-               return NS_ERROR_FAILURE;
+            if (!JS_HasProperty(cx, obj, "message", &found))
+                return NS_ERROR_FAILURE;
 
-            if (found && !JS_GetPropertyAttributes(cx, obj, "result", &ignored, &found))
+            if (found && !JS_HasProperty(cx, obj, "result", &found))
                 return NS_ERROR_FAILURE;
 
             if (found) {
                 // lets try to build a wrapper around the JSObject
                 nsXPCWrappedJS* jswrapper;
                 nsresult rv =
                     nsXPCWrappedJS::GetNewOrUsed(obj, NS_GET_IID(nsIException),
                                                  nullptr, &jswrapper);