Bug 927204 - Cannot AddNamedRoot a nullptr, r=terrence

This commit is contained in:
Steve Fink
2013-10-15 21:41:36 -07:00
parent 1773f4db93
commit 7627b71c29

View File

@@ -50,8 +50,6 @@ BEGIN_TEST(testChromeBuffer)
if (!JS_AddNamedObjectRoot(cx, &trusted_glob, "trusted-global"))
return false;
if (!JS_AddNamedObjectRoot(cx, &trusted_fun, "trusted-function"))
return false;
JSFunction *fun;
@@ -70,6 +68,8 @@ BEGIN_TEST(testChromeBuffer)
"trusted", 1, &paramName, bytes, strlen(bytes),
"", 0));
trusted_fun = JS_GetFunctionObject(fun);
if (!JS_AddNamedObjectRoot(cx, &trusted_fun, "trusted-function"))
return false;
}
JS::RootedValue v(cx, JS::ObjectValue(*trusted_fun));