Bug 987794 - Don't unwrap XrayWrappers in HasPropertyOnPrototype. r=bz
authorBobby Holley <bobbyholley@gmail.com>
Thu, 02 Oct 2014 18:34:16 +0200
changeset 208482 74871c4df0a7fba0b772de9a22dd63890add7a67
parent 208481 ddbbf282044179f2c436d8441e878a104c7dc7c6
child 208483 4c05532b63420ee67a57904ee4427bdc96a68a39
push id27585
push useremorley@mozilla.com
push dateFri, 03 Oct 2014 13:26:33 +0000
treeherdermozilla-central@e4f5e843a370 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs987794
milestone35.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 987794 - Don't unwrap XrayWrappers in HasPropertyOnPrototype. r=bz
dom/bindings/BindingUtils.cpp
--- a/dom/bindings/BindingUtils.cpp
+++ b/dom/bindings/BindingUtils.cpp
@@ -1590,27 +1590,20 @@ GetPropertyOnPrototype(JSContext* cx, JS
   *vp = value;
   return true;
 }
 
 bool
 HasPropertyOnPrototype(JSContext* cx, JS::Handle<JSObject*> proxy,
                        JS::Handle<jsid> id)
 {
-  JS::Rooted<JSObject*> obj(cx, proxy);
-  Maybe<JSAutoCompartment> ac;
-  if (xpc::WrapperFactory::IsXrayWrapper(obj)) {
-    obj = js::UncheckedUnwrap(obj);
-    ac.emplace(cx, obj);
-  }
-
   bool found;
   // We ignore an error from GetPropertyOnPrototype.  We pass nullptr
   // for vp so that GetPropertyOnPrototype won't actually do a get.
-  return !GetPropertyOnPrototype(cx, obj, id, &found, nullptr) || found;
+  return !GetPropertyOnPrototype(cx, proxy, id, &found, nullptr) || found;
 }
 
 bool
 AppendNamedPropertyIds(JSContext* cx, JS::Handle<JSObject*> proxy,
                        nsTArray<nsString>& names,
                        bool shadowPrototypeProperties,
                        JS::AutoIdVector& props)
 {