Index: src/wp-includes/class.wp-scripts.php
===================================================================
--- src/wp-includes/class.wp-scripts.php	(revision 28865)
+++ src/wp-includes/class.wp-scripts.php	(working copy)
@@ -82,26 +82,30 @@
 	}
 
 	public function do_item( $handle, $group = false ) {
-		if ( !parent::do_item($handle) )
+		if ( !parent::do_item( $handle ) ) {
 			return false;
+		}
 
-		if ( 0 === $group && $this->groups[$handle] > 0 ) {
+		if ( 0 === $group && $this->groups[ $handle ] > 0 ) {
 			$this->in_footer[] = $handle;
 			return false;
 		}
 
-		if ( false === $group && in_array($handle, $this->in_footer, true) )
+		if ( false === $group && in_array($handle, $this->in_footer, true) ) {
 			$this->in_footer = array_diff( $this->in_footer, (array) $handle );
+		}
 
-		if ( null === $this->registered[$handle]->ver )
+		if ( null === $this->registered[ $handle ]->ver ) {
 			$ver = '';
-		else
-			$ver = $this->registered[$handle]->ver ? $this->registered[$handle]->ver : $this->default_version;
+		} else {
+			$ver = $this->registered[ $handle ]->ver ? $this->registered[ $handle ]->ver : $this->default_version;
+		}
 
-		if ( isset($this->args[$handle]) )
-			$ver = $ver ? $ver . '&amp;' . $this->args[$handle] : $this->args[$handle];
+		if ( isset( $this->args[ $handle ] ) ) {
+			$ver = $ver ? $ver . '&amp;' . $this->args[ $handle ] : $this->args[ $handle ];
+		}
 
-		$src = $this->registered[$handle]->src;
+		$src = $this->registered[ $handle ]->src;
 
 		if ( $this->do_concat ) {
 			/**
@@ -113,7 +117,7 @@
 			 * @param string $handle Script handle.
 			 */
 			$srce = apply_filters( 'script_loader_src', $src, $handle );
-			if ( $this->in_default_dir($srce) ) {
+			if ( $this->in_default_dir( $srce ) ) {
 				$this->print_code .= $this->print_extra_script( $handle, false );
 				$this->concat .= "$handle,";
 				$this->concat_version .= "$handle$ver";
@@ -125,28 +129,68 @@
 		}
 
 		$this->print_extra_script( $handle );
-		if ( !preg_match('|^(https?:)?//|', $src) && ! ( $this->content_url && 0 === strpos($src, $this->content_url) ) ) {
+		if ( !preg_match( '|^(https?:)?//|', $src ) && ! ( $this->content_url && 0 === strpos( $src, $this->content_url ) ) ) {
 			$src = $this->base_url . $src;
 		}
 
-		if ( !empty($ver) )
+		if ( !empty( $ver ) ) {
 			$src = add_query_arg('ver', $ver, $src);
+		}
 
 		/** This filter is documented in wp-includes/class.wp-scripts.php */
 		$src = esc_url( apply_filters( 'script_loader_src', $src, $handle ) );
 
-		if ( ! $src )
+		if ( ! $src ) {
 			return true;
+		}
 
-		if ( $this->do_concat )
-			$this->print_html .= "<script type='text/javascript' src='$src'></script>\n";
-		else
-			echo "<script type='text/javascript' src='$src'></script>\n";
+		$attributes = $this->get_script_attributes( $handle, $src );
+		$script_tag = "<script$attributes src='$src'></script>\n";
 
+		if ( $this->do_concat ) {
+			$this->print_html .= $script_tag;
+		} else {
+			echo $script_tag;
+		}
+
 		return true;
 	}
 
 	/**
+	 * Concatenates attributes for the script tag
+	 *
+	 * @since  4.0.0
+	 *
+	 * @param  string $handle Script registered handle
+	 * @param  string $src    Script registered src
+	 *
+	 * @return string         Concatenated attributes string
+	 */
+	public function get_script_attributes( $handle, $src ) {
+		$default_attributes = array( 'type' => 'text/javascript' );
+
+		/**
+		 * Filter the script loader attributes.
+		 *
+		 * @since 4.0.0
+		 *
+		 * @param array  $default_attributes Array of default script tag attributes.
+		 * @param string $handle             Script handle.
+		 * @param string $src                Script loader source path.
+		 */
+		$attributes = apply_filters( 'script_loader_attributes', $default_attributes, $handle, $src );
+
+		$concat_attributes = '';
+		foreach ( $attributes as $attribute => $attribute_value ) {
+			if ( ! is_null( $attribute ) && ! is_null( $attribute_value ) ) {
+				$concat_attributes .= ' '. esc_attr( $attribute ) .'="'. esc_attr( $attribute_value ) .'"';
+			}
+		}
+
+		return $concat_attributes;
+	}
+
+	/**
 	 * Localizes a script
 	 *
 	 * Localizes only if the script has already been added
