Bug 1417209 - Do not fail when version parameter is found. r=mrbkap a=jorgk DONTBUILD THUNDERBIRD580b1_2017112101_RELBRANCH
authorMasatoshi Kimura <VYV03354@nifty.ne.jp>
Thu, 16 Nov 2017 21:21:39 +0900
branchTHUNDERBIRD580b1_2017112101_RELBRANCH
changeset 442472 c2375c4f241468cfa7a8297b6b5cdfbcb890fd3c
parent 442388 267010f9177f84745156c79c5cda48c1f2b6e6d9
child 442473 db229170890e3a38bb4fd59733192d33060013b9
push id8222
push usermozilla@jorgk.com
push dateFri, 24 Nov 2017 21:15:38 +0000
treeherdermozilla-beta@c2375c4f2414 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmrbkap, jorgk
bugs1417209
milestone58.0
Bug 1417209 - Do not fail when version parameter is found. r=mrbkap a=jorgk DONTBUILD I used ReportToConsoleNonLocalized to make the patch upliftable. MozReview-Commit-ID: LsOBOfzU9Hr
dom/xul/nsXULContentSink.cpp
--- a/dom/xul/nsXULContentSink.cpp
+++ b/dom/xul/nsXULContentSink.cpp
@@ -863,17 +863,23 @@ XULContentSinkImpl::OpenScript(const cha
               isJavaScript = true;
               version = JSVERSION_DEFAULT;
 
               // Get the version string, and ensure that JavaScript supports it.
               nsAutoString versionName;
               rv = parser.GetParameter("version", versionName);
 
               if (NS_SUCCEEDED(rv)) {
-                  version = JSVERSION_UNKNOWN;
+                  nsContentUtils::ReportToConsoleNonLocalized(
+                      NS_LITERAL_STRING("Versioned JavaScripts are no longer supported. "
+                                        "Please remove the version parameter."),
+                      nsIScriptError::errorFlag,
+                      NS_LITERAL_CSTRING("XUL Document"),
+                      nullptr, mDocumentURL, EmptyString(), aLineNumber);
+                  isJavaScript = false;
               } else if (rv != NS_ERROR_INVALID_ARG) {
                   return rv;
               }
           } else {
               isJavaScript = false;
           }
       } else if (key.EqualsLiteral("language")) {
           // Language is deprecated, and the impl in ScriptLoader ignores the