Index: src/wp-includes/class.wp-scripts.php
===================================================================
--- src/wp-includes/class.wp-scripts.php	(revision 36138)
+++ src/wp-includes/class.wp-scripts.php	(working copy)
@@ -190,7 +190,8 @@
 		if ( ! $src )
 			return true;
 
-		$tag = "{$cond_before}<script type='text/javascript' src='$src'></script>\n{$cond_after}";
+		$attributes = $this->get_script_attributes( $handle, $src );
+		$tag = "{$cond_before}<script$attributes></script>\n{$cond_after}";
 
 		/**
 		 * Filter the HTML script tag of an enqueued script.
@@ -213,6 +214,52 @@
 	}
 
 	/**
+	 * 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',
+			'src'  => $src
+		);
+
+		$attributes = isset( $this->registered[ $handle ]->args['attributes'] )
+			? (array) $this->registered[ $handle ]->args['attributes']
+			: array();
+
+		$attributes = wp_parse_args( $attributes, $default_attributes );
+
+		/**
+		* Filter the script loader attributes.
+		*
+		* @since 4.1.0
+		*
+		* @param array  $attributes Array of script tag attributes.
+		* @param string $handle     Script handle.
+		* @param string $src        Script loader source path.
+		*/
+		$attributes = apply_filters( 'script_loader_attributes', $attributes, $handle, $src );
+		// Ensure source is set.
+		$attributes['src'] = isset( $attributes['src'] ) ? $attributes['src'] : $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, only if the script has already been added
 	 *
 	 * @param string $handle
Index: src/wp-includes/functions.wp-scripts.php
===================================================================
--- src/wp-includes/functions.wp-scripts.php	(revision 36138)
+++ src/wp-includes/functions.wp-scripts.php	(working copy)
@@ -95,6 +95,7 @@
  *
  * @since 2.6.0
  * @since 4.3.0 A return value was added.
+ * @since 4.5.0 The fifth argument was changed to an array of options.
  *
  * @param string      $handle    Name of the script. Should be unique.
  * @param string      $src       Path to the script from the WordPress root directory. Example: '/js/myscript.js'.
@@ -104,16 +105,31 @@
  *                               to end of path as a query string. If no version is specified or set to false, a version
  *                               number is automatically added equal to current installed WordPress version.
  *                               If set to null, no version is added. Default 'false'. Accepts 'false', 'null', or 'string'.
- * @param bool        $in_footer Optional. Whether to enqueue the script before </head> or before </body>.
- *                               Default 'false'. Accepts 'false' or 'true'.
+ * @param array       $args {
+ *     Optional script arguments.
+ *
+ *     @type bool  $in_footer  Whether to enqueue the script before </head> or before </body>.
+ *                             Default 'false'. Accepts 'false' or 'true'.
+ *     @type array $attributes Array of script tag attributes.
+ *                             Default: array( 'type' => 'text/javascript' )
+ * }
  * @return bool Whether the script has been registered. True on success, false on failure.
  */
-function wp_register_script( $handle, $src, $deps = array(), $ver = false, $in_footer = false ) {
+function wp_register_script( $handle, $src, $deps = array(), $ver = false, $args = array() ) {
 	$wp_scripts = wp_scripts();
 	_wp_scripts_maybe_doing_it_wrong( __FUNCTION__ );
 
-	$registered = $wp_scripts->add( $handle, $src, $deps, $ver );
-	if ( $in_footer ) {
+	// Back-compat. If the fifth argument is not an array, it's `in_footer`.
+	$args = ! is_array( $args ) ? array( 'in_footer' => (bool) $args ) : $args;
+	$args = wp_parse_args( $args, array(
+		'in_footer'  => false,
+		'attributes' => array(),
+	) );
+
+	$attributes = wp_parse_args( $args['attributes'], array( 'type' => 'text/javascript' ) );
+
+	$registered = $wp_scripts->add( $handle, $src, $deps, $ver, array( 'attributes' => $attributes ) );
+	if ( $args['in_footer'] ) {
 		$wp_scripts->add_data( $handle, 'group', 1 );
 	}
 
@@ -211,6 +227,7 @@
  * @see WP_Dependencies::enqueue()
  *
  * @since 2.6.0
+ * @since 4.5.0 The fifth argument was changed to an array of options.
  *
  * @param string      $handle    Name of the script.
  * @param string|bool $src       Path to the script from the root directory of WordPress. Example: '/js/myscript.js'.
@@ -218,23 +235,37 @@
  * @param string|bool $ver       Optional. String specifying the script version number, if it has one. This parameter
  *                               is used to ensure that the correct version is sent to the client regardless of caching,
  *                               and so should be included if a version number is available and makes sense for the script.
- * @param bool        $in_footer Optional. Whether to enqueue the script before </head> or before </body>.
- *                               Default 'false'. Accepts 'false' or 'true'.
+ * @param array       $args {
+ *     Optional script arguments.
+ *
+ *     @type bool  $in_footer  Whether to enqueue the script before </head> or before </body>.
+ *                             Default 'false'. Accepts 'false' or 'true'.
+ *     @type array $attributes Array of script tag attributes.
+ *                             Default: array( 'type' => 'text/javascript' )
+ * }
  */
-function wp_enqueue_script( $handle, $src = false, $deps = array(), $ver = false, $in_footer = false ) {
+function wp_enqueue_script( $handle, $src = false, $deps = array(), $ver = false, $args = array() ) {
 	$wp_scripts = wp_scripts();
 
 	_wp_scripts_maybe_doing_it_wrong( __FUNCTION__ );
 
+	// Back-compat. If the fifth argument is not an array, it's `in_footer`.
+	$args = ! is_array( $args ) ? array( 'in_footer' => (bool) $args ) : $args;
+	$args = wp_parse_args( $args, array(
+		'in_footer'  => false,
+		'attributes' => array(),
+	) );
 
+	$attributes = wp_parse_args( $args['attributes'], array( 'type' => 'text/javascript' ) );
+
 	if ( $src || $in_footer ) {
 		$_handle = explode( '?', $handle );
 
 		if ( $src ) {
-			$wp_scripts->add( $_handle[0], $src, $deps, $ver );
+			$wp_scripts->add( $_handle[0], $src, $deps, $ver, array( 'attributes' => $attributes ) );
 		}
 
-		if ( $in_footer ) {
+		if ( $args['in_footer'] ) {
 			$wp_scripts->add_data( $_handle[0], 'group', 1 );
 		}
 	}
