Bug 1022773 - Switch all JS Compile functions to use MutableHandle, r=terrence

This commit is contained in:
Steve Fink
2014-06-25 15:35:35 -07:00
parent a59e646593
commit c4ab747155
18 changed files with 197 additions and 171 deletions

View File

@@ -71,8 +71,8 @@ BEGIN_TEST(testChromeBuffer)
JS::HandleObject global = JS::HandleObject::fromMarkedLocation(trusted_glob.unsafeGet());
JS::CompileOptions options(cx);
options.setFileAndLine("", 0);
CHECK(fun = JS_CompileFunction(cx, global, "trusted", 1, &paramName,
bytes, strlen(bytes), options));
CHECK(JS_CompileFunction(cx, global, "trusted", 1, &paramName,
bytes, strlen(bytes), options, &fun));
trusted_fun = JS_GetFunctionObject(fun);
if (!JS::AddNamedObjectRoot(cx, &trusted_fun, "trusted-function"))
return false;
@@ -93,8 +93,8 @@ BEGIN_TEST(testChromeBuffer)
"} ";
JS::CompileOptions options(cx);
options.setFileAndLine("", 0);
CHECK(fun = JS_CompileFunction(cx, global, "untrusted", 1, &paramName,
bytes, strlen(bytes), options));
CHECK(JS_CompileFunction(cx, global, "untrusted", 1, &paramName,
bytes, strlen(bytes), options, &fun));
JS::RootedValue rval(cx);
CHECK(JS_CallFunction(cx, JS::NullPtr(), fun, JS::HandleValueArray(v), &rval));
@@ -117,8 +117,8 @@ BEGIN_TEST(testChromeBuffer)
JS::HandleObject global = JS::HandleObject::fromMarkedLocation(trusted_glob.unsafeGet());
JS::CompileOptions options(cx);
options.setFileAndLine("", 0);
CHECK(fun = JS_CompileFunction(cx, global, "trusted", 1, &paramName,
bytes, strlen(bytes), options));
CHECK(JS_CompileFunction(cx, global, "trusted", 1, &paramName,
bytes, strlen(bytes), options, &fun));
trusted_fun = JS_GetFunctionObject(fun);
}
@@ -133,8 +133,8 @@ BEGIN_TEST(testChromeBuffer)
"} ";
JS::CompileOptions options(cx);
options.setFileAndLine("", 0);
CHECK(fun = JS_CompileFunction(cx, global, "untrusted", 1, &paramName,
bytes, strlen(bytes), options));
CHECK(JS_CompileFunction(cx, global, "untrusted", 1, &paramName,
bytes, strlen(bytes), options, &fun));
JS::RootedValue rval(cx);
CHECK(JS_CallFunction(cx, JS::NullPtr(), fun, JS::HandleValueArray(v), &rval));
@@ -154,8 +154,8 @@ BEGIN_TEST(testChromeBuffer)
JS::HandleObject global = JS::HandleObject::fromMarkedLocation(trusted_glob.unsafeGet());
JS::CompileOptions options(cx);
options.setFileAndLine("", 0);
CHECK(fun = JS_CompileFunction(cx, global, "trusted", 0, nullptr,
bytes, strlen(bytes), options));
CHECK(JS_CompileFunction(cx, global, "trusted", 0, nullptr,
bytes, strlen(bytes), options, &fun));
trusted_fun = JS_GetFunctionObject(fun);
}
@@ -170,8 +170,8 @@ BEGIN_TEST(testChromeBuffer)
"} ";
JS::CompileOptions options(cx);
options.setFileAndLine("", 0);
CHECK(fun = JS_CompileFunction(cx, global, "untrusted", 1, &paramName,
bytes, strlen(bytes), options));
CHECK(JS_CompileFunction(cx, global, "untrusted", 1, &paramName,
bytes, strlen(bytes), options, &fun));
JS::RootedValue arg(cx, JS::ObjectValue(*callTrusted));
JS::RootedValue rval(cx);