From 0c82b7b16d0fd1fb609bf5f3b400fb075ff87c3d Mon Sep 17 00:00:00 2001 From: Jon Coppeard Date: Wed, 29 Mar 2017 10:53:12 +0100 Subject: [PATCH] Bug 1322539 - Call ExposeObjectToActiveJS on the targets of xray wrappers r=sfink --- js/xpconnect/wrappers/XrayWrapper.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/js/xpconnect/wrappers/XrayWrapper.h b/js/xpconnect/wrappers/XrayWrapper.h index 4527e3b0a1f0..3afe33bf75b1 100644 --- a/js/xpconnect/wrappers/XrayWrapper.h +++ b/js/xpconnect/wrappers/XrayWrapper.h @@ -64,7 +64,10 @@ public: constexpr XrayTraits() {} static JSObject* getTargetObject(JSObject* wrapper) { - return js::UncheckedUnwrap(wrapper, /* stopAtWindowProxy = */ false); + JSObject* target = js::UncheckedUnwrap(wrapper, /* stopAtWindowProxy = */ false); + if (target) + JS::ExposeObjectToActiveJS(target); + return target; } virtual bool resolveNativeProperty(JSContext* cx, JS::HandleObject wrapper,