diff --git a/core/authorize.php b/core/authorize.php
index a6f97f3..c073f70 100644
--- a/core/authorize.php
+++ b/core/authorize.php
@@ -95,6 +95,10 @@ function authorize_access_allowed() {
   ->setFactoryClass('Drupal\Core\Asset\AssetManagerFactory')
   ->setFactoryMethod('get')
   ->addArgument('css');
+$container->register('js_asset_manager', 'Drupal\Core\Asset\JsAssetManager')
+  ->setFactoryClass('Drupal\Core\Asset\AssetManagerFactory')
+  ->setFactoryMethod('get')
+  ->addArgument('js');
 
 $output = '';
 $show_messages = TRUE;
diff --git a/core/includes/common.inc b/core/includes/common.inc
index 87e4d38..536324f 100644
--- a/core/includes/common.inc
+++ b/core/includes/common.inc
@@ -3848,81 +3848,19 @@ function drupal_js_defaults($data = NULL) {
  * @see locale_js_alter()
  * @see drupal_js_defaults()
  */
-function drupal_get_js($scope = 'header', $javascript = NULL, $skip_alter = FALSE) {
-  if (!isset($javascript)) {
-    $javascript = drupal_add_js();
-  }
-  if (empty($javascript)) {
-    return '';
-  }
+function drupal_get_js($scope = 'header', $js = NULL, $skip_alter = FALSE) {
+  $javascript = drupal_container()->get('js_asset_manager');
+  return;
+  $javascript->set($js);
 
   // Allow modules to alter the JavaScript.
   if (!$skip_alter) {
-    drupal_alter('js', $javascript);
-  }
-
-  // Filter out elements of the given scope.
-  $items = array();
-  foreach ($javascript as $key => $item) {
-    if ($item['scope'] == $scope) {
-      $items[$key] = $item;
-    }
+    drupal_alter('js', $javascript->assets);
   }
 
-  if (!empty($items)) {
-    // Sort the JavaScript files so that they appear in the correct order.
-    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('request') && $container->has('content_negotiation')) {
-      $type = $container->get('content_negotiation')->getContentType($container->get('request'));
-    }
-    if (!empty($items['settings']) || (!empty($type) && $type == 'ajax')) {
-      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.
-      // @see ajax_base_page_theme()
-      $setting['ajaxPageState']['theme'] = $theme_key;
-      // Checks that the DB is available before filling theme_token.
-      if (!defined('MAINTENANCE_MODE')) {
-        $setting['ajaxPageState']['theme_token'] = drupal_get_token($theme_key);
-      }
-
-      // Provide the page with information about the individual JavaScript files
-      // used, information not otherwise available when aggregation is enabled.
-      $setting['ajaxPageState']['js'] = array_fill_keys(array_keys($items), 1);
-      unset($setting['ajaxPageState']['js']['settings']);
-
-      // Provide the page with information about the individual CSS files used,
-      // information not otherwise available when CSS aggregation is enabled.
-      // The setting is attached later in this function, but is set here, so
-      // that CSS files removed in drupal_process_attached() are still
-      // considered "used" and prevented from being added in a later AJAX
-      // request.
-      // Skip if no files were added to the page otherwise jQuery.extend() will
-      // overwrite the Drupal.settings.ajaxPageState.css object with an empty
-      // array.
-      $css = drupal_add_css();
-      if (!empty($css)) {
-        // Cast the array to an object to be on the safe side even if not empty.
-        $setting['ajaxPageState']['css'] = (object) array_fill_keys(array_keys($css), 1);
-      }
-
-      drupal_add_js($setting, 'setting');
-
-      // If we're outputting the header scope, then this might be the final time
-      // that drupal_get_js() is running, so add the settings to this output as well
-      // as to the drupal_add_js() cache. If $items['settings'] doesn't exist, it's
-      // because drupal_get_js() was intentionally passed a $javascript argument
-      // stripped of settings, potentially in order to override how settings get
-      // output, so in this case, do not add the setting to this output.
-      if ($scope == 'header' && isset($items['settings'])) {
-        $items['settings']['data'][] = $setting;
-      }
-    }
-  }
+  $javascript->filter($scope);
+  $javascript->sort();
+  $javascript->prerender($scope);
 
   // Render the HTML needed to load the JavaScript.
   $elements = array(
diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc
index c6ef4f7..842573f 100644
--- a/core/includes/install.core.inc
+++ b/core/includes/install.core.inc
@@ -326,6 +326,10 @@ function install_begin_request(&$install_state) {
       ->setFactoryClass('Drupal\Core\Asset\AssetManagerFactory')
       ->setFactoryMethod('get')
       ->addArgument('css');
+    $container->register('js_asset_manager', 'Drupal\Core\Asset\JsAssetManager')
+      ->setFactoryClass('Drupal\Core\Asset\AssetManagerFactory')
+      ->setFactoryMethod('get')
+      ->addArgument('js');
     drupal_container($container);
   }
 
diff --git a/core/lib/Drupal/Core/Asset/AssetManagerFactory.php b/core/lib/Drupal/Core/Asset/AssetManagerFactory.php
index c8644b1..9323b6f 100644
--- a/core/lib/Drupal/Core/Asset/AssetManagerFactory.php
+++ b/core/lib/Drupal/Core/Asset/AssetManagerFactory.php
@@ -48,7 +48,7 @@ public static function getTypes() {
     $asset_types = isset($conf['asset_classes']) ? $conf['asset_classes'] : array();
     // Ensure there is a default 'generic' definition.
     $asset_types += array('css' => 'Drupal\Core\Asset\CssAssetManager');
-    // $asset_types += array('js' => 'Drupal\Core\Asset\JsAssetManager');
+    $asset_types += array('js' => 'Drupal\Core\Asset\JsAssetManager');
     return $asset_types;
   }
 
diff --git a/core/lib/Drupal/Core/Asset/CssAssetManager.php b/core/lib/Drupal/Core/Asset/CssAssetManager.php
index b4b93f2..f3f7c3b 100644
--- a/core/lib/Drupal/Core/Asset/CssAssetManager.php
+++ b/core/lib/Drupal/Core/Asset/CssAssetManager.php
@@ -39,7 +39,7 @@ function set($css = NULL) {
     if (!isset($css)) {
       $css = drupal_add_css();
     }
-      $this->assets = $css;
+    $this->assets = $css;
   }
 
   /**
diff --git a/core/lib/Drupal/Core/CoreBundle.php b/core/lib/Drupal/Core/CoreBundle.php
index aedf263..83f4935 100644
--- a/core/lib/Drupal/Core/CoreBundle.php
+++ b/core/lib/Drupal/Core/CoreBundle.php
@@ -58,10 +58,10 @@ public function build(ContainerBuilder $container) {
       ->setFactoryClass('Drupal\Core\Asset\AssetManagerFactory')
       ->setFactoryMethod('get')
       ->addArgument('css');
-    /*$container->register('js_asset_manager', 'Drupal\Core\Assets\CssAssetCollection')
-      ->setFactoryClass('Drupal\Core\Assets\AssetCollectionFactory')
+    $container->register('js_asset_manager', 'Drupal\Core\Assets\JsAssetManager')
+      ->setFactoryClass('Drupal\Core\Assets\AssetManagerFactory')
       ->setFactoryMethod('get')
-      ->addArgument('js');*/
+      ->addArgument('js');
     $container->register('typed_data', 'Drupal\Core\TypedData\TypedDataManager');
     // Add the user's storage for temporary, non-cache data.
     $container->register('lock', 'Drupal\Core\Lock\DatabaseLockBackend');
diff --git a/core/update.php b/core/update.php
index 4824cf2..25ce655 100644
--- a/core/update.php
+++ b/core/update.php
@@ -460,6 +460,10 @@ function update_check_requirements($skip_warnings = FALSE) {
   ->setFactoryClass('Drupal\Core\Asset\AssetManagerFactory')
   ->setFactoryMethod('get')
   ->addArgument('css');
+$container->register('js_asset_manager', 'Drupal\Core\Asset\JsAssetManager')
+  ->setFactoryClass('Drupal\Core\Asset\AssetManagerFactory')
+  ->setFactoryMethod('get')
+  ->addArgument('js');
 // Turn error reporting back on. From now on, only fatal errors (which are
 // not passed through the error handler) will cause a message to be printed.
 ini_set('display_errors', TRUE);
