Bug 843829 - Apply transitive waivers for nativeCall. r=mrbkap
☠☠ backed out by e60919ded783 ☠ ☠
authorBobby Holley <bobbyholley@gmail.com>
Tue, 02 Apr 2013 18:51:20 -0700
changeset 137979 2e889cd77a4875c2aa91475f5d808bd3fa1af58e
parent 137978 97d16e7beb271701b2c8b647a80807dfc064a2a4
child 137980 57652d8f082735c1e81dba6836d1091994e3542a
push id2579
push userakeybl@mozilla.com
push dateMon, 24 Jun 2013 18:52:47 +0000
treeherdermozilla-beta@b69b7de8a05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmrbkap
bugs843829
milestone23.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 843829 - Apply transitive waivers for nativeCall. r=mrbkap
js/xpconnect/wrappers/WaiveXrayWrapper.cpp
js/xpconnect/wrappers/WaiveXrayWrapper.h
--- a/js/xpconnect/wrappers/WaiveXrayWrapper.cpp
+++ b/js/xpconnect/wrappers/WaiveXrayWrapper.cpp
@@ -80,9 +80,19 @@ WaiveXrayWrapper::call(JSContext *cx, JS
 bool
 WaiveXrayWrapper::construct(JSContext *cx, JS::Handle<JSObject*> wrapper,
                               unsigned argc, js::Value *argv, JS::MutableHandle<JS::Value> rval)
 {
     return CrossCompartmentWrapper::construct(cx, wrapper, argc, argv, rval) &&
            WrapperFactory::WaiveXrayAndWrap(cx, rval.address());
 }
 
+// NB: This is important as the other side of a handshake with FieldGetter. See
+// nsXBLProtoImplField.cpp.
+bool
+WaiveXrayWrapper::nativeCall(JSContext *cx, JS::IsAcceptableThis test,
+                             JS::NativeImpl impl, JS::CallArgs args)
+{
+    return CrossCompartmentWrapper::nativeCall(cx, test, impl, args) &&
+           WrapperFactory::WaiveXrayAndWrap(cx, args.rval().address());
 }
+
+}
--- a/js/xpconnect/wrappers/WaiveXrayWrapper.h
+++ b/js/xpconnect/wrappers/WaiveXrayWrapper.h
@@ -31,14 +31,17 @@ class WaiveXrayWrapper : public js::Cros
                      JS::Handle<jsid> id, JS::MutableHandle<JS::Value> vp) MOZ_OVERRIDE;
 
     virtual bool call(JSContext *cx, JS::Handle<JSObject*> wrapper, unsigned argc,
                       js::Value *vp) MOZ_OVERRIDE;
     virtual bool construct(JSContext *cx, JS::Handle<JSObject*> wrapper,
                            unsigned argc, js::Value *argv,
                            JS::MutableHandle<JS::Value> rval) MOZ_OVERRIDE;
 
+    virtual bool nativeCall(JSContext *cx, JS::IsAcceptableThis test,
+                            JS::NativeImpl impl, JS::CallArgs args) MOZ_OVERRIDE;
+
     static WaiveXrayWrapper singleton;
 };
 
 }
 
 #endif