Bug 776490 - variable lock (lockPref) does not work, r=bzbarsky

This commit is contained in:
Martin Stransky 2012-07-26 12:39:31 -04:00
parent 3036961c68
commit e64e226ce4

View File

@ -19,6 +19,9 @@
#include "nsIJSContextStack.h"
#include "nspr.h"
#include "mozilla/Attributes.h"
#include "nsContentUtils.h"
#include "nsIScriptSecurityManager.h"
#include "nsJSPrincipals.h"
extern PRLogModuleInfo *MCD;
@ -192,8 +195,11 @@ nsresult EvaluateAdminConfigScript(const char *js_buffer, size_t length,
}
JS_BeginRequest(autoconfig_cx);
ok = JS_EvaluateScript(autoconfig_cx, autoconfig_glob,
js_buffer, length, filename, 0, nsnull);
nsCOMPtr<nsIPrincipal> principal;
nsContentUtils::GetSecurityManager()->GetSystemPrincipal(getter_AddRefs(principal));
ok = JS_EvaluateScriptForPrincipals(autoconfig_cx, autoconfig_glob,
nsJSPrincipals::get(principal),
js_buffer, length, filename, 0, nsnull);
JS_EndRequest(autoconfig_cx);
JS_MaybeGC(autoconfig_cx);