Bug 1033697 - Remove the temporary variable 'v' from XPCConvert::NativeInterface2JSObject; r=bholley
authorMs2ger <ms2ger@gmail.com>
Thu, 03 Jul 2014 14:58:06 +0200
changeset 212985 1cea3e0939e2f8376c74d4f26e85ff938b169e55
parent 212984 a481b4bc3ae666ed2e168291cb11fd04d0899064
child 212986 2ff73cfaac1300bc4fae71eb3796a9a411b39868
push id3857
push userraliiev@mozilla.com
push dateTue, 02 Sep 2014 16:39:23 +0000
treeherdermozilla-beta@5638b907b505 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbholley
bugs1033697
milestone33.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 1033697 - Remove the temporary variable 'v' from XPCConvert::NativeInterface2JSObject; r=bholley There is no good reason to keep the additional local variable, especially because it is only used inside this branch.
js/xpconnect/src/XPCConvert.cpp
--- a/js/xpconnect/src/XPCConvert.cpp
+++ b/js/xpconnect/src/XPCConvert.cpp
@@ -875,19 +875,18 @@ XPCConvert::NativeInterface2JSObject(Mut
 
     // If creating the wrapped native failed, then return early.
     if (NS_FAILED(rv) || !wrapper)
         return false;
 
     // If we're not creating security wrappers, we can return the
     // XPCWrappedNative as-is here.
     flat = wrapper->GetFlatJSObject();
-    jsval v = OBJECT_TO_JSVAL(flat);
     if (!allowNativeWrapper) {
-        d.set(v);
+        d.setObjectOrNull(flat);
         if (dest)
             wrapper.forget(dest);
         if (pErr)
             *pErr = NS_OK;
         return true;
     }
 
     // The call to wrap here handles both cross-compartment and same-compartment