From c047547318fad605af46e7d1a7d6a7b78cc0e8e6 Mon Sep 17 00:00:00 2001
From: webchick <webchick@24967.no-reply.drupal.org>
Date: Sat, 16 Mar 2013 23:38:24 -0700
Subject: [PATCH] Issue #1941288 by larowlan: Cleanup container call in
 drupal_get_js().

---
 core/includes/common.inc | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/core/includes/common.inc b/core/includes/common.inc
index 88d6fd3df127..02957d32890b 100644
--- a/core/includes/common.inc
+++ b/core/includes/common.inc
@@ -3839,12 +3839,7 @@ function drupal_get_js($scope = 'header', $javascript = NULL, $skip_alter = FALS
     uasort($items, 'drupal_sort_css_js');
     // Don't add settings if there is no other JavaScript on the page, unless
     // this is an AJAX request.
-    // @todo Clean up container call.
-    $container = drupal_container();
-    if ($container->has('content_negotiation') && $container->isScopeActive('request')) {
-      $type = $container->get('content_negotiation')->getContentType($container->get('request'));
-    }
-    if (!empty($items['settings']) || (!empty($type) && $type == 'ajax')) {
+    if (!empty($items['settings']) || Drupal::service('request')->isXmlHttpRequest()) {
       global $theme_key;
       // Provide the page with information about the theme that's used, so that
       // a later AJAX request can be rendered using the same theme.
-- 
GitLab