Bug 1282746. r=Waldo a=gchang
authorEric Faust <efaustbmo@gmail.com>
Tue, 16 Aug 2016 09:28:26 -0400
changeset 350034 29375a8f7973425e1e1759fe5608e7a18e4e1f01
parent 350033 7380ab03cf390926270fd5d66e17352c8f7d7d9f
child 350035 97c87f3e3854a925376ceab268e37df796cd574d
push id1230
push userjlund@mozilla.com
push dateMon, 31 Oct 2016 18:13:35 +0000
treeherdermozilla-release@5e06e3766db2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersWaldo, gchang
bugs1282746
milestone50.0a2
Bug 1282746. r=Waldo a=gchang
js/src/proxy/CrossCompartmentWrapper.cpp
--- a/js/src/proxy/CrossCompartmentWrapper.cpp
+++ b/js/src/proxy/CrossCompartmentWrapper.cpp
@@ -112,16 +112,20 @@ bool
 CrossCompartmentWrapper::getPrototypeIfOrdinary(JSContext* cx, HandleObject wrapper,
                                                 bool* isOrdinary, MutableHandleObject protop) const
 {
     {
         RootedObject wrapped(cx, wrappedObject(wrapper));
         AutoCompartment call(cx, wrapped);
         if (!GetPrototypeIfOrdinary(cx, wrapped, isOrdinary, protop))
             return false;
+
+        if (!*isOrdinary)
+            return true;
+
         if (protop) {
             if (!protop->setDelegate(cx))
                 return false;
         }
     }
 
     return cx->compartment()->wrap(cx, protop);
 }