Bug 1122195 - Only allow objects for setGCCallback parameter, r=terrence

--HG--
extra : rebase_source : 4cbd0223e49289dc5dbde593899ff0cca2e343f5
This commit is contained in:
Steve Fink 2015-01-16 12:50:19 -08:00
parent 92516a5212
commit 0dd21980ef

View File

@ -1713,8 +1713,8 @@ SetGCCallback(JSContext *cx, unsigned argc, jsval *vp)
return false;
}
RootedObject opts(cx);
if (!JS_ValueToObject(cx, args[0], &opts))
RootedObject opts(cx, ToObject(cx, args[0]));
if (!opts)
return false;
RootedValue v(cx);