Bug 1298773 - Expose wrappees that may be used through a wrapper; r=jonco
☠☠ backed out by 526f72b839de ☠ ☠
authorTerrence Cole <terrence@mozilla.com>
Wed, 14 Sep 2016 14:17:46 -0700
changeset 315184 ac1ae4224375da1de66ddf78658fe49fd972486f
parent 315183 ace491cb598e8767a76e817f111e534fda405518
child 315185 65566510613321ab3153c5e602b6fb7a42cbc5d1
push id32563
push userihsiao@mozilla.com
push dateMon, 26 Sep 2016 11:18:33 +0000
treeherderautoland@eb840c87b5fd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjonco
bugs1298773
milestone52.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 1298773 - Expose wrappees that may be used through a wrapper; r=jonco
js/src/proxy/Wrapper.cpp
--- a/js/src/proxy/Wrapper.cpp
+++ b/js/src/proxy/Wrapper.cpp
@@ -324,17 +324,20 @@ Wrapper::wrapperHandler(JSObject* wrappe
     MOZ_ASSERT(wrapper->is<WrapperObject>());
     return static_cast<const Wrapper*>(wrapper->as<ProxyObject>().handler());
 }
 
 JSObject*
 Wrapper::wrappedObject(JSObject* wrapper)
 {
     MOZ_ASSERT(wrapper->is<WrapperObject>());
-    return wrapper->as<ProxyObject>().target();
+    JSObject* target = wrapper->as<ProxyObject>().target();
+    if (target)
+        JS::ExposeObjectToActiveJS(target);
+    return target;
 }
 
 JS_FRIEND_API(JSObject*)
 js::UncheckedUnwrap(JSObject* wrapped, bool stopAtWindowProxy, unsigned* flagsp)
 {
     unsigned flags = 0;
     while (true) {
         if (!wrapped->is<WrapperObject>() ||