Bug 1142859. Don't parent the object created by JS_DefineObject to the object we're defining on. r=waldo

This commit is contained in:
Boris Zbarsky 2015-03-14 01:36:17 -04:00
parent c4105cdb82
commit 562ae11f1e

View File

@ -2604,7 +2604,7 @@ JS_DefineObject(JSContext *cx, HandleObject obj, const char *name, const JSClass
if (!clasp)
clasp = &PlainObject::class_; /* default class is Object */
RootedObject nobj(cx, NewObjectWithClassProto(cx, clasp, NullPtr(), obj));
RootedObject nobj(cx, NewObjectWithClassProto(cx, clasp, NullPtr(), NullPtr()));
if (!nobj)
return nullptr;