Bug 1302858. Remove unnecessary JS_WrapValue from dom::MaybeWrapObjectValue. r=peterv
authorBoris Zbarsky <bzbarsky@mit.edu>
Tue, 20 Sep 2016 13:25:05 +0100
changeset 415588 e6abf7c38f0f32367217802c73a7ca8a888b3008
parent 415587 3c60fe237a35defea33b60a4a0ab15b700cdc110
child 415589 9169054bf50447beb0a7793b1c289763ec12ba79
push id29910
push userbmo:ttromey@mozilla.com
push dateTue, 20 Sep 2016 18:24:54 +0000
reviewerspeterv
bugs1302858
milestone52.0a1
Bug 1302858. Remove unnecessary JS_WrapValue from dom::MaybeWrapObjectValue. r=peterv
dom/bindings/BindingUtils.h
--- a/dom/bindings/BindingUtils.h
+++ b/dom/bindings/BindingUtils.h
@@ -794,19 +794,19 @@ MaybeWrapObjectValue(JSContext* cx, JS::
   }
 
   // We're same-compartment, but even then we might need to wrap
   // objects specially.  Check for that.
   if (IsDOMObject(obj)) {
     return TryToOuterize(rval);
   }
 
-  // It's not a WebIDL object.  But it might be an XPConnect one, in which case
-  // we may need to outerize here, so make sure to call JS_WrapValue.
-  return JS_WrapValue(cx, rval);
+  // It's not a WebIDL object, so it's OK to just leave it as-is: only WebIDL
+  // objects (specifically only windows) require outerization.
+  return true;
 }
 
 // Like MaybeWrapObjectValue, but also allows null
 MOZ_ALWAYS_INLINE
 bool
 MaybeWrapObjectOrNullValue(JSContext* cx, JS::MutableHandle<JS::Value> rval)
 {
   MOZ_ASSERT(rval.isObjectOrNull());