Bug 1417209 - Do not fail when version parameter is found. r=mrbkap
authorMasatoshi Kimura <VYV03354@nifty.ne.jp>
Thu, 16 Nov 2017 21:21:39 +0900
changeset 446680 988c9c017c7041c5843ca396dce68f5f00af7aed
parent 446679 e0bd3937d98a6d7d3f871e06fbacf4c45cf83657
child 446681 2492b082f42f9366fb99329ab967cfb71cc6a5f8
push id1648
push usermtabara@mozilla.com
push dateThu, 01 Mar 2018 12:45:47 +0000
treeherdermozilla-release@cbb9688c2eeb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmrbkap
bugs1417209
milestone59.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 1417209 - Do not fail when version parameter is found. r=mrbkap 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