hgweb: look up "URLSearchParams" in "window" to work around jshint issues
authorAnton Shestakov <av6@dwimlabs.net>
Wed, 22 Nov 2017 22:11:37 +0800
changeset 35182 1207a50a6dc3
parent 35181 69a865dc2ada
child 35183 bdd2e18b54c5
hgweb: look up "URLSearchParams" in "window" to work around jshint issues Unfortunately, current version of jshint (2.9.5) doesn't know such a global variable and complains that it's undefined. Since this line tries to look up URLSearchParams in a global scope (i.e. window), let's simply preface it with "window." to work around jshint.
mercurial/templates/static/mercurial.js
--- a/mercurial/templates/static/mercurial.js	Wed Nov 22 21:49:36 2017 +0800
+++ b/mercurial/templates/static/mercurial.js	Wed Nov 22 22:11:37 2017 +0800
@@ -451,7 +451,7 @@
         "ignoreblanklines",
     ];
 
-    var urlParams = new URLSearchParams(window.location.search);
+    var urlParams = new window.URLSearchParams(window.location.search);
 
     function updateAndRefresh(e) {
         var checkbox = e.target;