Jelajahi Sumber

SyntaxError: Identifier 'Cls' has already been declared

Simon Legner 1 tahun lalu
induk
melakukan
e6983b0a9d
48 mengubah file dengan 204 tambahan dan 216 penghapusan
  1. 4 4
      assets/javascripts/app/db.js
  2. 3 3
      assets/javascripts/app/router.js
  3. 4 4
      assets/javascripts/app/searcher.js
  4. 3 3
      assets/javascripts/app/serviceworker.js
  5. 4 4
      assets/javascripts/app/settings.js
  6. 3 3
      assets/javascripts/app/shortcuts.js
  7. 4 4
      assets/javascripts/collections/docs.js
  8. 3 3
      assets/javascripts/collections/entries.js
  9. 4 4
      assets/javascripts/collections/types.js
  10. 51 57
      assets/javascripts/lib/cookies_store.js
  11. 4 4
      assets/javascripts/models/entry.js
  12. 3 3
      assets/javascripts/views/content/content.js
  13. 4 4
      assets/javascripts/views/content/entry_page.js
  14. 3 3
      assets/javascripts/views/content/offline_page.js
  15. 3 3
      assets/javascripts/views/content/root_page.js
  16. 3 3
      assets/javascripts/views/content/settings_page.js
  17. 3 3
      assets/javascripts/views/content/static_page.js
  18. 3 3
      assets/javascripts/views/content/type_page.js
  19. 3 3
      assets/javascripts/views/layout/document.js
  20. 3 3
      assets/javascripts/views/layout/menu.js
  21. 3 3
      assets/javascripts/views/layout/mobile.js
  22. 3 3
      assets/javascripts/views/layout/path.js
  23. 4 4
      assets/javascripts/views/layout/resizer.js
  24. 4 4
      assets/javascripts/views/layout/settings.js
  25. 3 3
      assets/javascripts/views/list/list_focus.js
  26. 3 3
      assets/javascripts/views/list/list_fold.js
  27. 3 3
      assets/javascripts/views/list/list_select.js
  28. 4 4
      assets/javascripts/views/list/paginated_list.js
  29. 3 3
      assets/javascripts/views/misc/news.js
  30. 3 3
      assets/javascripts/views/misc/notice.js
  31. 3 3
      assets/javascripts/views/misc/notif.js
  32. 3 3
      assets/javascripts/views/misc/tip.js
  33. 3 3
      assets/javascripts/views/misc/updates.js
  34. 3 3
      assets/javascripts/views/pages/hidden.js
  35. 3 5
      assets/javascripts/views/pages/jquery.js
  36. 3 3
      assets/javascripts/views/pages/rdoc.js
  37. 3 5
      assets/javascripts/views/pages/sqlite.js
  38. 3 3
      assets/javascripts/views/pages/support_tables.js
  39. 4 4
      assets/javascripts/views/search/search.js
  40. 4 4
      assets/javascripts/views/search/search_scope.js
  41. 3 3
      assets/javascripts/views/sidebar/doc_list.js
  42. 3 3
      assets/javascripts/views/sidebar/doc_picker.js
  43. 3 5
      assets/javascripts/views/sidebar/entry_list.js
  44. 3 3
      assets/javascripts/views/sidebar/results.js
  45. 3 3
      assets/javascripts/views/sidebar/sidebar.js
  46. 3 3
      assets/javascripts/views/sidebar/sidebar_hover.js
  47. 3 3
      assets/javascripts/views/sidebar/type_list.js
  48. 3 3
      assets/javascripts/views/view.js

+ 4 - 4
assets/javascripts/app/db.js

@@ -12,7 +12,7 @@
 (function () {
   let NAME = undefined;
   let VERSION = undefined;
-  const Cls = (app.DB = class DB {
+  app.DB = class DB {
     static initClass() {
       NAME = "docs";
       VERSION = 15;
@@ -586,7 +586,7 @@
     userVersion() {
       return app.settings.get("schema");
     }
-  });
-  Cls.initClass();
-  return Cls;
+  };
+  app.DB.initClass();
+  return app.DB;
 })();

+ 3 - 3
assets/javascripts/app/router.js

@@ -9,7 +9,7 @@
  * DS207: Consider shorter variations of null checks
  * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
  */
-const Cls = (app.Router = class Router {
+app.Router = class Router {
   static initClass() {
     $.extend(this.prototype, Events);
 
@@ -231,8 +231,8 @@ const Cls = (app.Router = class Router {
       true,
     );
   }
-});
-Cls.initClass();
+};
+app.Router.initClass();
 
 function __guard__(value, transform) {
   return typeof value !== "undefined" && value !== null

+ 4 - 4
assets/javascripts/app/searcher.js

@@ -172,7 +172,7 @@ function scoreFuzzyMatch() {
   let EMPTY_STRING = undefined;
   let ELLIPSIS = undefined;
   let STRING = undefined;
-  const Cls = (app.Searcher = class Searcher {
+  app.Searcher = class Searcher {
     static initClass() {
       $.extend(this.prototype, Events);
 
@@ -404,9 +404,9 @@ function scoreFuzzyMatch() {
       }
       return new RegExp(chars.join(".*?"));
     }
-  });
-  Cls.initClass();
-  return Cls; // abc -> /a.*?b.*?c.*?/
+  };
+  app.Searcher.initClass();
+  return app.Searcher; // abc -> /a.*?b.*?c.*?/
 })();
 
 app.SynchronousSearcher = class SynchronousSearcher extends app.Searcher {

+ 3 - 3
assets/javascripts/app/serviceworker.js

@@ -6,7 +6,7 @@
  * DS206: Consider reworking classes to avoid initClass
  * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
  */
-const Cls = (app.ServiceWorker = class ServiceWorker {
+app.ServiceWorker = class ServiceWorker {
   static initClass() {
     $.extend(this.prototype, Events);
   }
@@ -78,5 +78,5 @@ const Cls = (app.ServiceWorker = class ServiceWorker {
       this.trigger("updateready");
     }
   }
-});
-Cls.initClass();
+};
+app.ServiceWorker.initClass();

+ 4 - 4
assets/javascripts/app/settings.js

@@ -13,7 +13,7 @@
 (function () {
   let PREFERENCE_KEYS = undefined;
   let INTERNAL_KEYS = undefined;
-  const Cls = (app.Settings = class Settings {
+  app.Settings = class Settings {
     static initClass() {
       PREFERENCE_KEYS = [
         "hideDisabled",
@@ -240,9 +240,9 @@
         );
       }
     }
-  });
-  Cls.initClass();
-  return Cls;
+  };
+  app.Settings.initClass();
+  return app.Settings;
 })();
 
 function __guard__(value, transform) {

+ 3 - 3
assets/javascripts/app/shortcuts.js

@@ -8,7 +8,7 @@
  * DS206: Consider reworking classes to avoid initClass
  * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
  */
-const Cls = (app.Shortcuts = class Shortcuts {
+app.Shortcuts = class Shortcuts {
   static initClass() {
     $.extend(this.prototype, Events);
   }
@@ -305,8 +305,8 @@ const Cls = (app.Shortcuts = class Shortcuts {
       return true;
     }
   }
-});
-Cls.initClass();
+};
+app.Shortcuts.initClass();
 
 function __guard__(value, transform) {
   return typeof value !== "undefined" && value !== null

+ 4 - 4
assets/javascripts/collections/docs.js

@@ -12,7 +12,7 @@
   let NORMALIZE_VERSION_RGX = undefined;
   let NORMALIZE_VERSION_SUB = undefined;
   let CONCURRENCY = undefined;
-  const Cls = (app.collections.Docs = class Docs extends app.Collection {
+  app.collections.Docs = class Docs extends app.Collection {
     static initClass() {
       this.model = "Doc";
 
@@ -136,7 +136,7 @@
         }
       });
     }
-  });
-  Cls.initClass();
-  return Cls;
+  };
+  app.collections.Docs.initClass();
+  return app.collections.Docs;
 })();

+ 3 - 3
assets/javascripts/collections/entries.js

@@ -5,9 +5,9 @@
  * DS206: Consider reworking classes to avoid initClass
  * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
  */
-const Cls = (app.collections.Entries = class Entries extends app.Collection {
+app.collections.Entries = class Entries extends app.Collection {
   static initClass() {
     this.model = "Entry";
   }
-});
-Cls.initClass();
+};
+app.collections.Entries.initClass();

+ 4 - 4
assets/javascripts/collections/types.js

@@ -11,7 +11,7 @@
 (function () {
   let GUIDES_RGX = undefined;
   let APPENDIX_RGX = undefined;
-  const Cls = (app.collections.Types = class Types extends app.Collection {
+  app.collections.Types = class Types extends app.Collection {
     static initClass() {
       this.model = "Type";
 
@@ -40,7 +40,7 @@
         return 1;
       }
     }
-  });
-  Cls.initClass();
-  return Cls;
+  };
+  app.collections.Types.initClass();
+  return app.collections.Types;
 })();

+ 51 - 57
assets/javascripts/lib/cookies_store.js

@@ -8,72 +8,66 @@
  * DS207: Consider shorter variations of null checks
  * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
  */
-(function () {
-  let INT = undefined;
-  const Cls = (this.CookiesStore = class CookiesStore {
-    static initClass() {
-      // Intentionally called CookiesStore instead of CookieStore
-      // Calling it CookieStore causes issues when the Experimental Web Platform features flag is enabled in Chrome
-      // Related issue: https://github.com/freeCodeCamp/devdocs/issues/932
+// Intentionally called CookiesStore instead of CookieStore
+// Calling it CookieStore causes issues when the Experimental Web Platform features flag is enabled in Chrome
+// Related issue: https://github.com/freeCodeCamp/devdocs/issues/932
+class CookiesStore {
+  static INT = /^\d+$/;
 
-      INT = /^\d+$/;
-    }
-
-    static onBlocked() {}
+  static onBlocked() {}
 
-    get(key) {
-      let value = Cookies.get(key);
-      if (value != null && INT.test(value)) {
-        value = parseInt(value, 10);
-      }
-      return value;
+  get(key) {
+    let value = Cookies.get(key);
+    if (value != null && CookiesStore.INT.test(value)) {
+      value = parseInt(value, 10);
     }
+    return value;
+  }
 
-    set(key, value) {
-      if (value === false) {
-        this.del(key);
-        return;
-      }
-
-      if (value === true) {
-        value = 1;
-      }
-      if (
-        value &&
-        (typeof INT.test === "function" ? INT.test(value) : undefined)
-      ) {
-        value = parseInt(value, 10);
-      }
-      Cookies.set(key, "" + value, { path: "/", expires: 1e8 });
-      if (this.get(key) !== value) {
-        this.constructor.onBlocked(key, value, this.get(key));
-      }
+  set(key, value) {
+    if (value === false) {
+      this.del(key);
+      return;
     }
 
-    del(key) {
-      Cookies.expire(key);
+    if (value === true) {
+      value = 1;
     }
-
-    reset() {
-      try {
-        for (var cookie of Array.from(document.cookie.split(/;\s?/))) {
-          Cookies.expire(cookie.split("=")[0]);
-        }
-        return;
-      } catch (error) {}
+    if (
+      value &&
+      (typeof CookiesStore.INT.test === "function"
+        ? CookiesStore.INT.test(value)
+        : undefined)
+    ) {
+      value = parseInt(value, 10);
+    }
+    Cookies.set(key, "" + value, { path: "/", expires: 1e8 });
+    if (this.get(key) !== value) {
+      CookiesStore.onBlocked(key, value, this.get(key));
     }
+  }
 
-    dump() {
-      const result = {};
+  del(key) {
+    Cookies.expire(key);
+  }
+
+  reset() {
+    try {
       for (var cookie of Array.from(document.cookie.split(/;\s?/))) {
-        if (cookie[0] !== "_") {
-          cookie = cookie.split("=");
-          result[cookie[0]] = cookie[1];
-        }
+        Cookies.expire(cookie.split("=")[0]);
+      }
+      return;
+    } catch (error) {}
+  }
+
+  dump() {
+    const result = {};
+    for (var cookie of Array.from(document.cookie.split(/;\s?/))) {
+      if (cookie[0] !== "_") {
+        cookie = cookie.split("=");
+        result[cookie[0]] = cookie[1];
       }
-      return result;
     }
-  });
-  Cls.initClass();
-  return Cls;
-})();
+    return result;
+  }
+}

+ 4 - 4
assets/javascripts/models/entry.js

@@ -10,7 +10,7 @@
 
 (function () {
   let applyAliases = undefined;
-  const Cls = (app.models.Entry = class Entry extends app.Model {
+  app.models.Entry = class Entry extends app.Model {
     static initClass() {
       let ALIASES;
       applyAliases = function (string) {
@@ -115,7 +115,7 @@
     loadFile(onSuccess, onError) {
       return app.db.load(this, onSuccess, onError);
     }
-  });
-  Cls.initClass();
-  return Cls;
+  };
+  app.models.Entry.initClass();
+  return app.models.Entry;
 })();

+ 3 - 3
assets/javascripts/views/content/content.js

@@ -12,7 +12,7 @@
  * DS207: Consider shorter variations of null checks
  * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
  */
-const Cls = (app.views.Content = class Content extends app.View {
+app.views.Content = class Content extends app.View {
   constructor(...args) {
     this.scrollToTop = this.scrollToTop.bind(this);
     this.scrollToBottom = this.scrollToBottom.bind(this);
@@ -276,8 +276,8 @@ const Cls = (app.views.Content = class Content extends app.View {
       ["http:/", "https:"].includes(needle)
     );
   }
-});
-Cls.initClass();
+};
+app.views.Content.initClass();
 
 function __guard__(value, transform) {
   return typeof value !== "undefined" && value !== null

+ 4 - 4
assets/javascripts/views/content/entry_page.js

@@ -12,7 +12,7 @@
  */
 (function () {
   let LINKS = undefined;
-  const Cls = (app.views.EntryPage = class EntryPage extends app.View {
+  app.views.EntryPage = class EntryPage extends app.View {
     constructor(...args) {
       this.beforeRoute = this.beforeRoute.bind(this);
       this.onSuccess = this.onSuccess.bind(this);
@@ -268,7 +268,7 @@
       }
       this.delay(() => $.popup(link.href + location.hash));
     }
-  });
-  Cls.initClass();
-  return Cls;
+  };
+  app.views.EntryPage.initClass();
+  return app.views.EntryPage;
 })();

+ 3 - 3
assets/javascripts/views/content/offline_page.js

@@ -8,7 +8,7 @@
  * DS206: Consider reworking classes to avoid initClass
  * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
  */
-const Cls = (app.views.OfflinePage = class OfflinePage extends app.View {
+app.views.OfflinePage = class OfflinePage extends app.View {
   constructor(...args) {
     this.onClick = this.onClick.bind(this);
     super(...args);
@@ -159,5 +159,5 @@ const Cls = (app.views.OfflinePage = class OfflinePage extends app.View {
       app.settings.set("manualUpdate", !event.target.checked);
     }
   }
-});
-Cls.initClass();
+};
+app.views.OfflinePage.initClass();

+ 3 - 3
assets/javascripts/views/content/root_page.js

@@ -7,7 +7,7 @@
  * DS206: Consider reworking classes to avoid initClass
  * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
  */
-const Cls = (app.views.RootPage = class RootPage extends app.View {
+app.views.RootPage = class RootPage extends app.View {
   constructor(...args) {
     this.onClick = this.onClick.bind(this);
     super(...args);
@@ -59,5 +59,5 @@ const Cls = (app.views.RootPage = class RootPage extends app.View {
       this.hideIntro();
     }
   }
-});
-Cls.initClass();
+};
+app.views.RootPage.initClass();

+ 3 - 3
assets/javascripts/views/content/settings_page.js

@@ -9,7 +9,7 @@
  * DS206: Consider reworking classes to avoid initClass
  * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
  */
-const Cls = (app.views.SettingsPage = class SettingsPage extends app.View {
+app.views.SettingsPage = class SettingsPage extends app.View {
   constructor(...args) {
     this.onChange = this.onChange.bind(this);
     this.onClick = this.onClick.bind(this);
@@ -159,5 +159,5 @@ const Cls = (app.views.SettingsPage = class SettingsPage extends app.View {
   onRoute(context) {
     this.render();
   }
-});
-Cls.initClass();
+};
+app.views.SettingsPage.initClass();

+ 3 - 3
assets/javascripts/views/content/static_page.js

@@ -6,7 +6,7 @@
  * DS206: Consider reworking classes to avoid initClass
  * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
  */
-const Cls = (app.views.StaticPage = class StaticPage extends app.View {
+app.views.StaticPage = class StaticPage extends app.View {
   static initClass() {
     this.className = "_static";
 
@@ -37,5 +37,5 @@ const Cls = (app.views.StaticPage = class StaticPage extends app.View {
   onRoute(context) {
     this.render(context.page || "notFound");
   }
-});
-Cls.initClass();
+};
+app.views.StaticPage.initClass();

+ 3 - 3
assets/javascripts/views/content/type_page.js

@@ -6,7 +6,7 @@
  * DS206: Consider reworking classes to avoid initClass
  * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
  */
-const Cls = (app.views.TypePage = class TypePage extends app.View {
+app.views.TypePage = class TypePage extends app.View {
   static initClass() {
     this.className = "_page";
   }
@@ -31,5 +31,5 @@ const Cls = (app.views.TypePage = class TypePage extends app.View {
   onRoute(context) {
     this.render(context.type);
   }
-});
-Cls.initClass();
+};
+app.views.TypePage.initClass();

+ 3 - 3
assets/javascripts/views/layout/document.js

@@ -8,7 +8,7 @@
  * DS207: Consider shorter variations of null checks
  * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
  */
-const Cls = (app.views.Document = class Document extends app.View {
+app.views.Document = class Document extends app.View {
   constructor(...args) {
     this.afterRoute = this.afterRoute.bind(this);
     this.onVisibilityChange = this.onVisibilityChange.bind(this);
@@ -138,5 +138,5 @@ const Cls = (app.views.Document = class Document extends app.View {
         break;
     }
   }
-});
-Cls.initClass();
+};
+app.views.Document.initClass();

+ 3 - 3
assets/javascripts/views/layout/menu.js

@@ -6,7 +6,7 @@
  * DS206: Consider reworking classes to avoid initClass
  * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
  */
-const Cls = (app.views.Menu = class Menu extends app.View {
+app.views.Menu = class Menu extends app.View {
   constructor(...args) {
     this.onGlobalClick = this.onGlobalClick.bind(this);
     super(...args);
@@ -44,5 +44,5 @@ const Cls = (app.views.Menu = class Menu extends app.View {
       this.removeClass(this.constructor.activeClass);
     }
   }
-});
-Cls.initClass();
+};
+app.views.Menu.initClass();

+ 3 - 3
assets/javascripts/views/layout/mobile.js

@@ -8,7 +8,7 @@
  * DS207: Consider shorter variations of null checks
  * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
  */
-const Cls = (app.views.Mobile = class Mobile extends app.View {
+app.views.Mobile = class Mobile extends app.View {
   static initClass() {
     this.className = "_mobile";
 
@@ -207,5 +207,5 @@ const Cls = (app.views.Mobile = class Mobile extends app.View {
       this.forward.setAttribute("disabled", "disabled");
     }
   }
-});
-Cls.initClass();
+};
+app.views.Mobile.initClass();

+ 3 - 3
assets/javascripts/views/layout/path.js

@@ -7,7 +7,7 @@
  * DS206: Consider reworking classes to avoid initClass
  * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
  */
-const Cls = (app.views.Path = class Path extends app.View {
+app.views.Path = class Path extends app.View {
   constructor(...args) {
     this.onClick = this.onClick.bind(this);
     this.afterRoute = this.afterRoute.bind(this);
@@ -65,5 +65,5 @@ const Cls = (app.views.Path = class Path extends app.View {
       app.document.sidebar.reset();
     }
   }
-});
-Cls.initClass();
+};
+app.views.Path.initClass();

+ 4 - 4
assets/javascripts/views/layout/resizer.js

@@ -10,7 +10,7 @@
 (function () {
   let MIN = undefined;
   let MAX = undefined;
-  const Cls = (app.views.Resizer = class Resizer extends app.View {
+  app.views.Resizer = class Resizer extends app.View {
     constructor(...args) {
       this.onDragStart = this.onDragStart.bind(this);
       this.onDrag = this.onDrag.bind(this);
@@ -83,7 +83,7 @@
       }
       this.resize(value, true);
     }
-  });
-  Cls.initClass();
-  return Cls;
+  };
+  app.views.Resizer.initClass();
+  return app.views.Resizer;
 })();

+ 4 - 4
assets/javascripts/views/layout/settings.js

@@ -12,7 +12,7 @@
  */
 (function () {
   let SIDEBAR_HIDDEN_LAYOUT = undefined;
-  const Cls = (app.views.Settings = class Settings extends app.View {
+  app.views.Settings = class Settings extends app.View {
     constructor(...args) {
       this.onChange = this.onChange.bind(this);
       this.onEnter = this.onEnter.bind(this);
@@ -131,7 +131,7 @@
         app.router.show("/");
       }
     }
-  });
-  Cls.initClass();
-  return Cls;
+  };
+  app.views.Settings.initClass();
+  return app.views.Settings;
 })();

+ 3 - 3
assets/javascripts/views/list/list_focus.js

@@ -8,7 +8,7 @@
  * DS207: Consider shorter variations of null checks
  * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
  */
-const Cls = (app.views.ListFocus = class ListFocus extends app.View {
+app.views.ListFocus = class ListFocus extends app.View {
   static initClass() {
     this.activeClass = "focus";
 
@@ -202,5 +202,5 @@ const Cls = (app.views.ListFocus = class ListFocus extends app.View {
       this.focus(target, { silent: true });
     }
   }
-});
-Cls.initClass();
+};
+app.views.ListFocus.initClass();

+ 3 - 3
assets/javascripts/views/list/list_fold.js

@@ -8,7 +8,7 @@
  * DS207: Consider shorter variations of null checks
  * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
  */
-const Cls = (app.views.ListFold = class ListFold extends app.View {
+app.views.ListFold = class ListFold extends app.View {
   static initClass() {
     this.targetClass = "_list-dir";
     this.handleClass = "_list-arrow";
@@ -117,5 +117,5 @@ const Cls = (app.views.ListFold = class ListFold extends app.View {
       }
     }
   }
-});
-Cls.initClass();
+};
+app.views.ListFold.initClass();

+ 3 - 3
assets/javascripts/views/list/list_select.js

@@ -8,7 +8,7 @@
  * DS206: Consider reworking classes to avoid initClass
  * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
  */
-const Cls = (app.views.ListSelect = class ListSelect extends app.View {
+app.views.ListSelect = class ListSelect extends app.View {
   static initClass() {
     this.activeClass = "active";
 
@@ -68,8 +68,8 @@ const Cls = (app.views.ListSelect = class ListSelect extends app.View {
       this.select(target);
     }
   }
-});
-Cls.initClass();
+};
+app.views.ListSelect.initClass();
 
 function __guard__(value, transform) {
   return typeof value !== "undefined" && value !== null

+ 4 - 4
assets/javascripts/views/list/paginated_list.js

@@ -12,7 +12,7 @@
  */
 (function () {
   let PER_PAGE = undefined;
-  const Cls = (app.views.PaginatedList = class PaginatedList extends app.View {
+  app.views.PaginatedList = class PaginatedList extends app.View {
     static initClass() {
       PER_PAGE = app.config.max_results;
     }
@@ -152,7 +152,7 @@
         this.paginate(target);
       }
     }
-  });
-  Cls.initClass();
-  return Cls;
+  };
+  app.views.PaginatedList.initClass();
+  return app.views.PaginatedList;
 })();

+ 3 - 3
assets/javascripts/views/misc/news.js

@@ -10,7 +10,7 @@
  */
 //= require views/misc/notif
 
-const Cls = (app.views.News = class News extends app.views.Notif {
+app.views.News = class News extends app.views.Notif {
   static initClass() {
     this.className += " _notif-news";
 
@@ -58,5 +58,5 @@ const Cls = (app.views.News = class News extends app.views.Notif {
   markAllAsRead() {
     app.settings.set("news", this.getLastNewsTime());
   }
-});
-Cls.initClass();
+};
+app.views.News.initClass();

+ 3 - 3
assets/javascripts/views/misc/notice.js

@@ -7,7 +7,7 @@
  * DS206: Consider reworking classes to avoid initClass
  * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
  */
-const Cls = (app.views.Notice = class Notice extends app.View {
+app.views.Notice = class Notice extends app.View {
   static initClass() {
     this.className = "_notice";
     this.attributes = { role: "alert" };
@@ -43,5 +43,5 @@ const Cls = (app.views.Notice = class Notice extends app.View {
   hide() {
     $.remove(this.el);
   }
-});
-Cls.initClass();
+};
+app.views.Notice.initClass();

+ 3 - 3
assets/javascripts/views/misc/notif.js

@@ -7,7 +7,7 @@
  * DS207: Consider shorter variations of null checks
  * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
  */
-const Cls = (app.views.Notif = class Notif extends app.View {
+app.views.Notif = class Notif extends app.View {
   static initClass() {
     this.className = "_notif";
     this.activeClass = "_in";
@@ -82,5 +82,5 @@ const Cls = (app.views.Notif = class Notif extends app.View {
       this.hide();
     }
   }
-});
-Cls.initClass();
+};
+app.views.Notif.initClass();

+ 3 - 3
assets/javascripts/views/misc/tip.js

@@ -7,7 +7,7 @@
  */
 //= require views/misc/notif
 
-const Cls = (app.views.Tip = class Tip extends app.views.Notif {
+app.views.Tip = class Tip extends app.views.Notif {
   static initClass() {
     this.className = "_notif _notif-tip";
 
@@ -17,5 +17,5 @@ const Cls = (app.views.Tip = class Tip extends app.views.Notif {
   render() {
     this.html(this.tmpl(`tip${this.type}`));
   }
-});
-Cls.initClass();
+};
+app.views.Tip.initClass();

+ 3 - 3
assets/javascripts/views/misc/updates.js

@@ -10,7 +10,7 @@
  */
 //= require views/misc/notif
 
-const Cls = (app.views.Updates = class Updates extends app.views.Notif {
+app.views.Updates = class Updates extends app.views.Notif {
   static initClass() {
     this.className += " _notif-news";
 
@@ -72,5 +72,5 @@ const Cls = (app.views.Updates = class Updates extends app.views.Notif {
         : Math.floor(Date.now() / 1000),
     );
   }
-});
-Cls.initClass();
+};
+app.views.Updates.initClass();

+ 3 - 3
assets/javascripts/views/pages/hidden.js

@@ -6,7 +6,7 @@
  * DS206: Consider reworking classes to avoid initClass
  * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
  */
-const Cls = (app.views.HiddenPage = class HiddenPage extends app.View {
+app.views.HiddenPage = class HiddenPage extends app.View {
   static initClass() {
     this.events = { click: "onClick" };
   }
@@ -30,5 +30,5 @@ const Cls = (app.views.HiddenPage = class HiddenPage extends app.View {
       $.popup(link);
     }
   }
-});
-Cls.initClass();
+};
+app.views.HiddenPage.initClass();

+ 3 - 5
assets/javascripts/views/pages/jquery.js

@@ -10,9 +10,7 @@
  */
 //= require views/pages/base
 
-const Cls = (app.views.JqueryPage = class JqueryPage extends (
-  app.views.BasePage
-) {
+app.views.JqueryPage = class JqueryPage extends app.views.BasePage {
   constructor(...args) {
     this.onIframeLoaded = this.onIframeLoaded.bind(this);
     super(...args);
@@ -92,5 +90,5 @@ const Cls = (app.views.JqueryPage = class JqueryPage extends (
     );
     return source.replace(/<script>/gi, '<script nonce="devdocs">');
   }
-});
-Cls.initClass();
+};
+app.views.JqueryPage.initClass();

+ 3 - 3
assets/javascripts/views/pages/rdoc.js

@@ -8,7 +8,7 @@
  */
 //= require views/pages/base
 
-const Cls = (app.views.RdocPage = class RdocPage extends app.views.BasePage {
+app.views.RdocPage = class RdocPage extends app.views.BasePage {
   static initClass() {
     this.events = { click: "onClick" };
   }
@@ -28,5 +28,5 @@ const Cls = (app.views.RdocPage = class RdocPage extends app.views.BasePage {
     source.style.display = isShown ? "none" : "block";
     return (event.target.textContent = isShown ? "Show source" : "Hide source");
   }
-});
-Cls.initClass();
+};
+app.views.RdocPage.initClass();

+ 3 - 5
assets/javascripts/views/pages/sqlite.js

@@ -8,9 +8,7 @@
  */
 //= require views/pages/base
 
-const Cls = (app.views.SqlitePage = class SqlitePage extends (
-  app.views.BasePage
-) {
+app.views.SqlitePage = class SqlitePage extends app.views.BasePage {
   constructor(...args) {
     this.onClick = this.onClick.bind(this);
     super(...args);
@@ -37,5 +35,5 @@ const Cls = (app.views.SqlitePage = class SqlitePage extends (
       event.target.textContent = "show";
     }
   }
-});
-Cls.initClass();
+};
+app.views.SqlitePage.initClass();

+ 3 - 3
assets/javascripts/views/pages/support_tables.js

@@ -7,7 +7,7 @@
  */
 //= require views/pages/base
 
-const Cls = (app.views.SupportTablesPage = class SupportTablesPage extends (
+app.views.SupportTablesPage = class SupportTablesPage extends (
   app.views.BasePage
 ) {
   static initClass() {
@@ -26,5 +26,5 @@ const Cls = (app.views.SupportTablesPage = class SupportTablesPage extends (
     }
     el.classList.add("show-all");
   }
-});
-Cls.initClass();
+};
+app.views.SupportTablesPage.initClass();

+ 4 - 4
assets/javascripts/views/search/search.js

@@ -12,7 +12,7 @@
 (function () {
   let SEARCH_PARAM = undefined;
   let HASH_RGX = undefined;
-  const Cls = (app.views.Search = class Search extends app.View {
+  app.views.Search = class Search extends app.View {
     constructor(...args) {
       this.focus = this.focus.bind(this);
       this.autoFocus = this.autoFocus.bind(this);
@@ -266,9 +266,9 @@
         );
       } catch (error) {}
     }
-  });
-  Cls.initClass();
-  return Cls;
+  };
+  app.views.Search.initClass();
+  return app.views.Search;
 })();
 
 function __guard__(value, transform) {

+ 4 - 4
assets/javascripts/views/search/search_scope.js

@@ -12,7 +12,7 @@
 (function () {
   let SEARCH_PARAM = undefined;
   let HASH_RGX = undefined;
-  const Cls = (app.views.SearchScope = class SearchScope extends app.View {
+  app.views.SearchScope = class SearchScope extends app.View {
     static initClass() {
       SEARCH_PARAM = app.config.search_param;
 
@@ -208,9 +208,9 @@
         this.selectDoc(context.doc);
       }
     }
-  });
-  Cls.initClass();
-  return Cls;
+  };
+  app.views.SearchScope.initClass();
+  return app.views.SearchScope;
 })();
 
 function __guard__(value, transform) {

+ 3 - 3
assets/javascripts/views/sidebar/doc_list.js

@@ -8,7 +8,7 @@
  * DS207: Consider shorter variations of null checks
  * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
  */
-const Cls = (app.views.DocList = class DocList extends app.View {
+app.views.DocList = class DocList extends app.View {
   constructor(...args) {
     this.render = this.render.bind(this);
     this.onOpen = this.onOpen.bind(this);
@@ -267,5 +267,5 @@ const Cls = (app.views.DocList = class DocList extends app.View {
       this.select(context.type || context.entry);
     }
   }
-});
-Cls.initClass();
+};
+app.views.DocList.initClass();

+ 3 - 3
assets/javascripts/views/sidebar/doc_picker.js

@@ -10,7 +10,7 @@
  * DS207: Consider shorter variations of null checks
  * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
  */
-const Cls = (app.views.DocPicker = class DocPicker extends app.View {
+app.views.DocPicker = class DocPicker extends app.View {
   constructor(...args) {
     this.onMouseDown = this.onMouseDown.bind(this);
     this.onMouseUp = this.onMouseUp.bind(this);
@@ -152,8 +152,8 @@ const Cls = (app.views.DocPicker = class DocPicker extends app.View {
     }
     this.focusEl = target;
   }
-});
-Cls.initClass();
+};
+app.views.DocPicker.initClass();
 
 function __guard__(value, transform) {
   return typeof value !== "undefined" && value !== null

+ 3 - 5
assets/javascripts/views/sidebar/entry_list.js

@@ -9,9 +9,7 @@
  */
 //= require views/list/paginated_list
 
-const Cls = (app.views.EntryList = class EntryList extends (
-  app.views.PaginatedList
-) {
+app.views.EntryList = class EntryList extends app.views.PaginatedList {
   static initClass() {
     this.tagName = "div";
     this.className = "_list _list-sub";
@@ -30,5 +28,5 @@ const Cls = (app.views.EntryList = class EntryList extends (
   render(entries) {
     return this.tmpl("sidebarEntry", entries);
   }
-});
-Cls.initClass();
+};
+app.views.EntryList.initClass();

+ 3 - 3
assets/javascripts/views/sidebar/results.js

@@ -8,7 +8,7 @@
  * DS207: Consider shorter variations of null checks
  * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
  */
-const Cls = (app.views.Results = class Results extends app.View {
+app.views.Results = class Results extends app.View {
   static initClass() {
     this.className = "_list";
 
@@ -112,5 +112,5 @@ const Cls = (app.views.Results = class Results extends app.View {
       }
     }
   }
-});
-Cls.initClass();
+};
+app.views.Results.initClass();

+ 3 - 3
assets/javascripts/views/sidebar/sidebar.js

@@ -9,7 +9,7 @@
  * DS207: Consider shorter variations of null checks
  * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
  */
-const Cls = (app.views.Sidebar = class Sidebar extends app.View {
+app.views.Sidebar = class Sidebar extends app.View {
   constructor(...args) {
     this.resetHoverOnMouseMove = this.resetHoverOnMouseMove.bind(this);
     this.resetHover = this.resetHover.bind(this);
@@ -239,8 +239,8 @@ const Cls = (app.views.Sidebar = class Sidebar extends app.View {
     }
     this.resetDisplay();
   }
-});
-Cls.initClass();
+};
+app.views.Sidebar.initClass();
 
 function __guardMethod__(obj, methodName, transform) {
   if (

+ 3 - 3
assets/javascripts/views/sidebar/sidebar_hover.js

@@ -9,7 +9,7 @@
  * DS207: Consider shorter variations of null checks
  * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
  */
-const Cls = (app.views.SidebarHover = class SidebarHover extends app.View {
+app.views.SidebarHover = class SidebarHover extends app.View {
   static initClass() {
     this.itemClass = "_list-hover";
 
@@ -138,8 +138,8 @@ const Cls = (app.views.SidebarHover = class SidebarHover extends app.View {
   onRoute() {
     this.hide();
   }
-});
-Cls.initClass();
+};
+app.views.SidebarHover.initClass();
 
 var isPointerEventsSupported = function () {
   const el = document.createElement("div");

+ 3 - 3
assets/javascripts/views/sidebar/type_list.js

@@ -9,7 +9,7 @@
  * DS206: Consider reworking classes to avoid initClass
  * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
  */
-const Cls = (app.views.TypeList = class TypeList extends app.View {
+app.views.TypeList = class TypeList extends app.View {
   static initClass() {
     this.tagName = "div";
     this.className = "_list _list-sub";
@@ -90,8 +90,8 @@ const Cls = (app.views.TypeList = class TypeList extends app.View {
       __guard__(this.lists[model.getType().slug], (x) => x.paginateTo(model));
     }
   }
-});
-Cls.initClass();
+};
+app.views.TypeList.initClass();
 
 function __guard__(value, transform) {
   return typeof value !== "undefined" && value !== null

+ 3 - 3
assets/javascripts/views/view.js

@@ -8,7 +8,7 @@
  * DS207: Consider shorter variations of null checks
  * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
  */
-const Cls = (app.View = class View {
+app.View = class View {
   static initClass() {
     $.extend(this.prototype, Events);
   }
@@ -253,5 +253,5 @@ const Cls = (app.View = class View {
     this.deactivate();
     $.remove(this.el);
   }
-});
-Cls.initClass();
+};
+app.View.initClass();