diff --git a/core/includes/common.inc b/core/includes/common.inc
index e73924d..5d568b3 100644
--- a/core/includes/common.inc
+++ b/core/includes/common.inc
@@ -1745,7 +1745,6 @@ function _drupal_add_js($data = NULL, $options = NULL) {
           url('', array('script' => &$scriptPath, 'prefix' => &$pathPrefix));
           $current_path = current_path();
           $current_path_is_admin = FALSE;
-          // The function path_is_admin() is not available on update.php pages.
           if (!(defined('MAINTENANCE_MODE'))) {
             $current_path_is_admin = \Drupal::service('router.admin_context')->isAdminRoute();
           }
diff --git a/core/modules/block/src/Controller/BlockController.php b/core/modules/block/src/Controller/BlockController.php
index a4e7952..0749081 100644
--- a/core/modules/block/src/Controller/BlockController.php
+++ b/core/modules/block/src/Controller/BlockController.php
@@ -61,9 +61,10 @@ public function demo($theme) {
         'js' => array(
           array(
             // The block demonstration page is not marked as an administrative
-            // page by path_is_admin() function in order to use the frontend
-            // theme. Since JavaScript relies on a proper separation of admin
-            // pages, it needs to know this is an actual administrative page.
+            // page by \Drupal::service('router.admin_context')->isAdminRoute()
+            // function in order to use the frontend theme. Since JavaScript
+            // relies on a proper separation of admin pages, it needs to know
+            // this is an actual administrative page.
             'data' => array('path' => array('currentPathIsAdmin' => TRUE)),
             'type' => 'setting',
           )
