diff --git a/core/modules/block/js/block.admin.js b/core/modules/block/js/block.admin.js
index b399dd0..23100e5 100644
--- a/core/modules/block/js/block.admin.js
+++ b/core/modules/block/js/block.admin.js
@@ -24,10 +24,12 @@
       var $details;
 
       /**
-       * Hides the `<details>` element for a category if it has no visible blocks.
+       * Hides the `<details>` element for a category with no visible blocks.
        *
-       * @param {number} index
+       * @param {number} [index]
+       *   The index in the loop, as provided by `jQuery.each`
        * @param {HTMLElement} element
+       *   The element to hide.
        */
       function hideCategoryDetails(index, element) {
         var $catDetails = $(element);
@@ -38,6 +40,7 @@
        * Filters the block list.
        *
        * @param {jQuery.Event} e
+       *   The jQuery event for the keyup event that triggered the filter.
        */
       function filterBlockList(e) {
         var query = $(e.target).val().toLowerCase();
@@ -46,7 +49,9 @@
          * Shows or hides the block entry based on the query.
          *
          * @param {number} index
+         *   The index in the loop, as provided by `jQuery.each`
          * @param {HTMLElement} block
+         *   The element to toggle.
          */
         function showBlockEntry(index, block) {
           var $block = $(block);
diff --git a/core/modules/block/js/block.js b/core/modules/block/js/block.js
index e5c0907..a481a1e 100644
--- a/core/modules/block/js/block.js
+++ b/core/modules/block/js/block.js
@@ -21,6 +21,15 @@
         return;
       }
 
+      /**
+       * Create a summary for checkboxes in the provided context.
+       *
+       * @param {HTMLElement} context
+       *   A context where one would find checkboxes to summarize.
+       *
+       * @returns {string}
+       *   A string with the summary.
+       */
       function checkboxesSummary(context) {
         var vals = [];
         var $checkboxes = $(context).find('input[type="checkbox"]:checked + label');
@@ -49,7 +58,7 @@
   };
 
   /**
-   * Move a block in the blocks table from one region to another via select list.
+   * Move a block in the blocks table between regions via select list.
    *
    * This behavior is dependent on the tableDrag behavior, since it uses the
    * objects initialized in that behavior to update the row.
@@ -63,6 +72,37 @@
         return;
       }
 
+      /**
+       * Function to check empty regions and toggle classes based on this.
+       *
+       * @param {jQuery} table
+       *   The jQuery object representing the table to inspect.
+       * @param {jQuery} rowObject
+       *   The jQuery object representing the table row.
+       */
+      function checkEmptyRegions(table, rowObject) {
+        table.find('tr.region-message').each(function () {
+          var $this = $(this);
+          // If the dragged row is in this region, but above the message row,
+          // swap it down one space.
+          if ($this.prev('tr').get(0) === rowObject.element) {
+            // Prevent a recursion problem when using the keyboard to move rows
+            // up.
+            if ((rowObject.method !== 'keyboard' || rowObject.direction === 'down')) {
+              rowObject.swap('after', this);
+            }
+          }
+          // This region has become empty.
+          if ($this.next('tr').is(':not(.draggable)') || $this.next('tr').length === 0) {
+            $this.removeClass('region-populated').addClass('region-empty');
+          }
+          // This region has become populated.
+          else if ($this.is('.region-empty')) {
+            $this.removeClass('region-empty').addClass('region-populated');
+          }
+        });
+      }
+
       var table = $('#blocks');
       // Get the blocks tableDrag object.
       var tableDrag = Drupal.tableDrag.blocks;
@@ -71,7 +111,8 @@
         checkEmptyRegions(table, this);
       };
 
-      // Add a handler so when a row is dropped, update fields dropped into new regions.
+      // Add a handler so when a row is dropped, update fields dropped into
+      // new regions.
       tableDrag.onDrop = function () {
         var dragObject = this;
         var $rowElement = $(dragObject.rowObject.element);
@@ -82,10 +123,11 @@
         var regionField = $rowElement.find('select.block-region-select');
         // Check whether the newly picked region is available for this block.
         if (regionField.find('option[value=' + regionName + ']').length === 0) {
-          // If not, alert the user and keep the block in its old region setting.
+          // If not, alert the user and keep the block in its old region
+          // setting.
           window.alert(Drupal.t('The block cannot be placed in this region.'));
-          // Simulate that there was a selected element change, so the row is put
-          // back to from where the user tried to drag it.
+          // Simulate that there was a selected element change, so the row is
+          // put back to from where the user tried to drag it.
           regionField.trigger('change');
         }
         else if ($rowElement.prev('tr').is('.region-message')) {
@@ -108,7 +150,8 @@
           var select = $(this);
           tableDrag.rowObject = new tableDrag.row(row);
 
-          // Find the correct region and insert the row as the last in the region.
+          // Find the correct region and insert the row as the last in the
+          // region.
           table.find('.region-' + select[0].value + '-message').nextUntil('.region-message').eq(-1).before(row);
 
           // Modify empty regions with added or removed fields.
@@ -117,27 +160,6 @@
           select.trigger('blur');
         });
       });
-
-      var checkEmptyRegions = function (table, rowObject) {
-        table.find('tr.region-message').each(function () {
-          var $this = $(this);
-          // If the dragged row is in this region, but above the message row, swap it down one space.
-          if ($this.prev('tr').get(0) === rowObject.element) {
-            // Prevent a recursion problem when using the keyboard to move rows up.
-            if ((rowObject.method !== 'keyboard' || rowObject.direction === 'down')) {
-              rowObject.swap('after', this);
-            }
-          }
-          // This region has become empty.
-          if ($this.next('tr').is(':not(.draggable)') || $this.next('tr').length === 0) {
-            $this.removeClass('region-populated').addClass('region-empty');
-          }
-          // This region has become populated.
-          else if ($this.is('.region-empty')) {
-            $this.removeClass('region-empty').addClass('region-populated');
-          }
-        });
-      };
     }
   };
 
