Bug 829205 - Some rooting in Object.cpp; r=terrence

This commit is contained in:
Ms2ger 2013-02-07 09:08:58 +01:00
Родитель 6748cbaf43
Коммит 7e2c95314c
1 изменённых файлов: 5 добавлений и 5 удалений

Просмотреть файл

@ -321,12 +321,12 @@ obj_toString(JSContext *cx, unsigned argc, Value *vp)
} }
/* Step 3. */ /* Step 3. */
JSObject *obj = ToObject(cx, args.thisv()); RootedObject obj(cx, ToObject(cx, args.thisv()));
if (!obj) if (!obj)
return false; return false;
/* Steps 4-5. */ /* Steps 4-5. */
JSString *str = js::obj_toStringHelper(cx, obj); UnrootedString str = js::obj_toStringHelper(cx, obj);
if (!str) if (!str)
return false; return false;
args.rval().setString(str); args.rval().setString(str);
@ -342,7 +342,7 @@ obj_toLocaleString(JSContext *cx, unsigned argc, Value *vp)
CallArgs args = CallArgsFromVp(argc, vp); CallArgs args = CallArgsFromVp(argc, vp);
/* Step 1. */ /* Step 1. */
JSObject *obj = ToObject(cx, args.thisv()); RootedObject obj(cx, ToObject(cx, args.thisv()));
if (!obj) if (!obj)
return false; return false;
@ -355,7 +355,7 @@ static JSBool
obj_valueOf(JSContext *cx, unsigned argc, Value *vp) obj_valueOf(JSContext *cx, unsigned argc, Value *vp)
{ {
CallArgs args = CallArgsFromVp(argc, vp); CallArgs args = CallArgsFromVp(argc, vp);
JSObject *obj = ToObject(cx, args.thisv()); RootedObject obj(cx, ToObject(cx, args.thisv()));
if (!obj) if (!obj)
return false; return false;
args.rval().setObject(*obj); args.rval().setObject(*obj);
@ -710,7 +710,7 @@ obj_create(JSContext *cx, unsigned argc, Value *vp)
return false; return false;
} }
JSObject *proto = v.toObjectOrNull(); RootedObject proto(cx, v.toObjectOrNull());
/* /*
* Use the callee's global as the parent of the new object to avoid dynamic * Use the callee's global as the parent of the new object to avoid dynamic