Bug 840488 - Remove nsIScriptContext script check in nsScriptLoader. r=bz

There are now no longer any consumers that set this to false.
This commit is contained in:
Bobby Holley 2013-11-12 16:43:34 -08:00
parent 775a7b7627
commit ec1faf6066

View File

@ -498,28 +498,6 @@ nsScriptLoader::ProcessScriptElement(nsIScriptElement *aElement)
return false; return false;
} }
// Script evaluation can also be disabled in the current script
// context even though it's enabled in the document.
// XXX - still hard-coded for JS here, even though another language
// may be specified. Should this check be made *after* we examine
// the attributes to locate the script-type?
// For now though, if JS is disabled we assume every language is
// disabled.
// XXX is this different from the mDocument->IsScriptEnabled() call?
nsCOMPtr<nsIScriptGlobalObject> globalObject =
do_QueryInterface(mDocument->GetWindow());
if (!globalObject) {
return false;
}
nsIScriptContext *context = globalObject->GetScriptContext();
// If scripts aren't enabled in the current context, there's no
// point in going on.
if (!context || !context->GetScriptsEnabled()) {
return false;
}
JSVersion version = JSVERSION_DEFAULT; JSVersion version = JSVERSION_DEFAULT;
// Check the type attribute to determine language and version. // Check the type attribute to determine language and version.