Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit c1c4213

Browse files
committed
Bug 861887 Review comments for prev patch r=bholley
--HG-- extra : rebase_source : 7f91680f5f7249c9fb09708eb790bdc19c779c67
1 parent 0c2b8de commit c1c4213

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

js/xpconnect/wrappers/XrayWrapper.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ GetXrayType(JSObject *obj)
6666
return NotXray;
6767
}
6868

69-
ResolvingId::ResolvingId(JSContext *cx, JSObject *wrapper, jsid id)
70-
: mId(cx, id),
69+
ResolvingId::ResolvingId(JSContext *cx, HandleObject wrapper, HandleId id)
70+
: mId(id),
7171
mHolder(cx, getHolderObject(wrapper)),
7272
mPrev(getResolvingId(mHolder)),
7373
mXrayShadowing(false)
@@ -123,7 +123,7 @@ ResolvingId::getResolvingIdFromWrapper(JSObject *wrapper)
123123
class MOZ_STACK_CLASS ResolvingIdDummy
124124
{
125125
public:
126-
ResolvingIdDummy(JSContext *cx, JSObject *wrapper, jsid id)
126+
ResolvingIdDummy(JSContext *cx, HandleObject wrapper, HandleId id)
127127
{
128128
}
129129
};
@@ -1183,7 +1183,7 @@ DOMXrayTraits::resolveNativeProperty(JSContext *cx, HandleObject wrapper,
11831183
HandleObject holder, HandleId id,
11841184
JSPropertyDescriptor *desc, unsigned flags)
11851185
{
1186-
JSObject *obj = getTargetObject(wrapper);
1186+
RootedObject obj(cx, getTargetObject(wrapper));
11871187
if (!XrayResolveNativeProperty(cx, wrapper, obj, id, desc))
11881188
return false;
11891189

@@ -1204,7 +1204,7 @@ DOMXrayTraits::resolveOwnProperty(JSContext *cx, Wrapper &jsWrapper, HandleObjec
12041204
if (!ok || desc->obj)
12051205
return ok;
12061206

1207-
JSObject *obj = getTargetObject(wrapper);
1207+
RootedObject obj(cx, getTargetObject(wrapper));
12081208
if (!XrayResolveOwnProperty(cx, wrapper, obj, id, desc, flags))
12091209
return false;
12101210

@@ -1222,7 +1222,7 @@ DOMXrayTraits::defineProperty(JSContext *cx, HandleObject wrapper, HandleId id,
12221222
if (!existingDesc.obj())
12231223
return true;
12241224

1225-
JSObject *obj = getTargetObject(wrapper);
1225+
RootedObject obj(cx, getTargetObject(wrapper));
12261226
if (!js::IsProxy(obj))
12271227
return true;
12281228

@@ -1694,7 +1694,7 @@ XrayWrapper<Base, Traits>::defineProperty(JSContext *cx, HandleObject wrapper,
16941694
if (!getOwnPropertyDescriptor(cx, wrapper, id, existing_desc.address(), JSRESOLVE_ASSIGNING))
16951695
return false;
16961696

1697-
if (existing_desc.object() && (existing_desc.get().attrs & JSPROP_PERMANENT))
1697+
if (existing_desc.object() && existing_desc.isPermanent())
16981698
return true; // silently ignore attempt to overwrite native property
16991699

17001700
bool defined = false;
@@ -1907,7 +1907,7 @@ do_QueryInterfaceNative(JSContext* cx, HandleObject wrapper)
19071907
{
19081908
nsISupports* nativeSupports;
19091909
if (IsWrapper(wrapper) && WrapperFactory::IsXrayWrapper(wrapper)) {
1910-
JSObject* target = XrayTraits::getTargetObject(wrapper);
1910+
RootedObject target(cx, XrayTraits::getTargetObject(wrapper));
19111911
if (GetXrayType(target) == XrayForDOMObject) {
19121912
if (!UnwrapDOMObjectToISupports(target, nativeSupports)) {
19131913
nativeSupports = nullptr;

js/xpconnect/wrappers/XrayWrapper.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ class XPCWrappedNativeXrayTraits;
169169

170170
class MOZ_STACK_CLASS ResolvingId {
171171
public:
172-
ResolvingId(JSContext *cx, JSObject *wrapper, jsid id);
172+
ResolvingId(JSContext *cx, JS::HandleObject wrapper, JS::HandleId id);
173173
~ResolvingId();
174174

175175
bool isXrayShadowing(jsid id);
@@ -182,7 +182,7 @@ class MOZ_STACK_CLASS ResolvingId {
182182
friend class AutoSetWrapperNotShadowing;
183183
friend class XPCWrappedNativeXrayTraits;
184184

185-
JS::RootedId mId;
185+
JS::HandleId mId;
186186
JS::RootedObject mHolder;
187187
ResolvingId *mPrev;
188188
bool mXrayShadowing;

0 commit comments

Comments
 (0)