Bug 1147946, part 2 - Move body of check inside prior if in XULContentSinkImpl::OpenScript(). r=baku
authorAndrew McCreight <continuation@gmail.com>
Thu, 02 Apr 2015 12:13:15 -0700
changeset 267278 f23b648a2970d4003bd2f003932fe508853bc45e
parent 267277 f421dc3eefe8b5ee87ddccbb2b2f517b38531ce7
child 267279 226747de554e70027e4bb2af524b154cb48bcd3a
push id4830
push userjlund@mozilla.com
push dateMon, 29 Jun 2015 20:18:48 +0000
treeherdermozilla-beta@4c2175bb0420 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku
bugs1147946
milestone40.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1147946, part 2 - Move body of check inside prior if in XULContentSinkImpl::OpenScript(). r=baku
dom/xul/nsXULContentSink.cpp
--- a/dom/xul/nsXULContentSink.cpp
+++ b/dom/xul/nsXULContentSink.cpp
@@ -882,30 +882,28 @@ XULContentSinkImpl::OpenScript(const cha
               }
               // We do want the warning here
               NS_ENSURE_SUCCESS(rv, rv);
           }
 
           if (nsContentUtils::IsJavascriptMIMEType(mimeType)) {
               langID = nsIProgrammingLanguage::JAVASCRIPT;
               version = JSVERSION_LATEST;
-          } else {
-              langID = nsIProgrammingLanguage::UNKNOWN;
-          }
 
-          if (langID != nsIProgrammingLanguage::UNKNOWN) {
-              // Get the version string, and ensure the language supports it.
+              // Get the version string, and ensure that JavaScript supports it.
               nsAutoString versionName;
               rv = parser.GetParameter("version", versionName);
 
               if (NS_SUCCEEDED(rv)) {
                   version = nsContentUtils::ParseJavascriptVersion(versionName);
               } else if (rv != NS_ERROR_INVALID_ARG) {
                   return rv;
               }
+          } else {
+              langID = nsIProgrammingLanguage::UNKNOWN;
           }
       } else if (key.EqualsLiteral("language")) {
           // Language is deprecated, and the impl in nsScriptLoader ignores the
           // various version strings anyway.  So we make no attempt to support
           // languages other than JS for language=
           nsAutoString lang(aAttributes[1]);
           if (nsContentUtils::IsJavaScriptLanguage(lang)) {
               version = JSVERSION_DEFAULT;