Bug 1142282 part 3. Remove the parent argument of NewNativeObjectWithClassProto. r=waldo

This commit is contained in:
Boris Zbarsky 2015-03-11 22:33:59 -04:00
parent d906706022
commit 530e295577
3 changed files with 7 additions and 11 deletions

View File

@ -2469,12 +2469,9 @@ DefineConstructorAndPrototype(JSContext *cx, HandleObject obj, JSProtoKey key, H
/*
* Create the prototype object. (GlobalObject::createBlankPrototype isn't
* used because it parents the prototype object to the global and because
* it uses WithProto::Given. FIXME: Undo dependencies on this parentage
* [which already needs to happen for bug 638316], figure out nicer
* semantics for null-protoProto, and use createBlankPrototype.)
* used because it won't let us use protoProto as the proto.
*/
RootedNativeObject proto(cx, NewNativeObjectWithClassProto(cx, clasp, protoProto, obj, SingletonObject));
RootedNativeObject proto(cx, NewNativeObjectWithClassProto(cx, clasp, protoProto, SingletonObject));
if (!proto)
return nullptr;

View File

@ -166,8 +166,7 @@ js::OnUnknownMethod(JSContext *cx, HandleObject obj, Value idval_, MutableHandle
return false;
if (value.isObject()) {
NativeObject *obj = NewNativeObjectWithClassProto(cx, &js_NoSuchMethodClass, NullPtr(),
NullPtr());
NativeObject *obj = NewNativeObjectWithClassProto(cx, &js_NoSuchMethodClass, NullPtr());
if (!obj)
return false;

View File

@ -376,17 +376,17 @@ NewNativeObjectWithGivenProto(ExclusiveContext *cx, const Class *clasp,
inline NativeObject *
NewNativeObjectWithClassProto(ExclusiveContext *cx, const Class *clasp, HandleObject proto,
HandleObject parent, gc::AllocKind allocKind,
gc::AllocKind allocKind,
NewObjectKind newKind = GenericObject)
{
return MaybeNativeObject(NewObjectWithClassProto(cx, clasp, proto, parent, allocKind, newKind));
return MaybeNativeObject(NewObjectWithClassProto(cx, clasp, proto, NullPtr(), allocKind, newKind));
}
inline NativeObject *
NewNativeObjectWithClassProto(ExclusiveContext *cx, const Class *clasp, HandleObject proto,
HandleObject parent, NewObjectKind newKind = GenericObject)
NewObjectKind newKind = GenericObject)
{
return MaybeNativeObject(NewObjectWithClassProto(cx, clasp, proto, parent, newKind));
return MaybeNativeObject(NewObjectWithClassProto(cx, clasp, proto, NullPtr(), newKind));
}
/*