Bug 980180 - remove principals as an argument to compilation, part 1 (r=terrence)

This commit is contained in:
Luke Wagner
2014-03-06 16:28:05 -06:00
parent 1197b85a3e
commit 8b5d14d078
26 changed files with 67 additions and 155 deletions

View File

@@ -65,8 +65,7 @@ BEGIN_TEST(testChromeBuffer)
const char *bytes = "return x ? 1 + trusted(x-1) : 0";
JS::HandleObject global = JS::HandleObject::fromMarkedLocation(&trusted_glob);
JS::CompileOptions options(cx);
options.setFileAndLine("", 0)
.setPrincipals(&system_principals);
options.setFileAndLine("", 0);
CHECK(fun = JS_CompileFunction(cx, global, "trusted", 1, &paramName,
bytes, strlen(bytes), options));
trusted_fun = JS_GetFunctionObject(fun);
@@ -112,8 +111,7 @@ BEGIN_TEST(testChromeBuffer)
"} ";
JS::HandleObject global = JS::HandleObject::fromMarkedLocation(&trusted_glob);
JS::CompileOptions options(cx);
options.setFileAndLine("", 0)
.setPrincipals(&system_principals);
options.setFileAndLine("", 0);
CHECK(fun = JS_CompileFunction(cx, global, "trusted", 1, &paramName,
bytes, strlen(bytes), options));
trusted_fun = JS_GetFunctionObject(fun);
@@ -150,8 +148,7 @@ BEGIN_TEST(testChromeBuffer)
const char *bytes = "return 42";
JS::HandleObject global = JS::HandleObject::fromMarkedLocation(&trusted_glob);
JS::CompileOptions options(cx);
options.setFileAndLine("", 0)
.setPrincipals(&system_principals);
options.setFileAndLine("", 0);
CHECK(fun = JS_CompileFunction(cx, global, "trusted", 0, nullptr,
bytes, strlen(bytes), options));
trusted_fun = JS_GetFunctionObject(fun);