Bug 927204 - Cannot AddNamedRoot a nullptr, r=terrence
This commit is contained in:
@@ -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, ¶mName, 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));
|
||||
|
||||
Reference in New Issue
Block a user