From 4177026c113b73a635caade07769991d3c34f431 Mon Sep 17 00:00:00 2001 From: Simon Legner Date: Sat, 6 Jan 2024 16:18:18 +0100 Subject: [PATCH] Sanity-check decaffeinate app.views.BasePage --- assets/javascripts/views/pages/base.js | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/assets/javascripts/views/pages/base.js b/assets/javascripts/views/pages/base.js index bc7c4125..40716785 100644 --- a/assets/javascripts/views/pages/base.js +++ b/assets/javascripts/views/pages/base.js @@ -1,12 +1,3 @@ -// TODO: This file was created by bulk-decaffeinate. -// Sanity-check the conversion and remove this comment. -/* - * decaffeinate suggestions: - * DS101: Remove unnecessary use of Array.from - * DS102: Remove unnecessary code created because of implicit returns - * DS207: Consider shorter variations of null checks - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md - */ app.views.BasePage = class BasePage extends app.View { constructor(el, entry) { super(el); @@ -44,7 +35,7 @@ app.views.BasePage = class BasePage extends app.View { } highlightCode() { - for (var el of Array.from(this.findAll("pre[data-language]"))) { + for (var el of this.findAll("pre[data-language]")) { var language = el.getAttribute("data-language"); el.classList.add(`language-${language}`); this.highlightNodes.push(el); @@ -65,9 +56,7 @@ app.views.BasePage = class BasePage extends app.View { this.nodesPerFrame = 10; } - for (var el of Array.from( - this.highlightNodes.splice(0, this.nodesPerFrame), - )) { + for (var el of this.highlightNodes.splice(0, this.nodesPerFrame)) { var clipEl; if ((clipEl = el.lastElementChild)) { $.remove(clipEl);