]> source.dussan.org Git - jquery.git/commitdiff
Manipulation: Reduce size by eliminating single-use variable
authorRichard Gibson <richard.gibson@gmail.com>
Wed, 22 Nov 2017 19:43:44 +0000 (14:43 -0500)
committerGitHub <noreply@github.com>
Wed, 22 Nov 2017 19:43:44 +0000 (14:43 -0500)
Closes gh-3851

src/manipulation.js

index 2db1cfe3fd9d40ef009624d5e4b531396af172a8..c30100ff8e41833b8e304850fd23cb059af22e48 100644 (file)
@@ -45,7 +45,6 @@ var
 
        // checked="checked" or checked
        rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
-       rscriptTypeMasked = /^true\/(.*)/,
        rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;
 
 // Prefer a tbody over its parent table for containing new rows
@@ -65,10 +64,8 @@ function disableScript( elem ) {
        return elem;
 }
 function restoreScript( elem ) {
-       var match = rscriptTypeMasked.exec( elem.type );
-
-       if ( match ) {
-               elem.type = match[ 1 ];
+       if ( ( elem.type || "" ).slice( 0, 5 ) === "true/" ) {
+               elem.type = elem.type.slice( 5 );
        } else {
                elem.removeAttribute( "type" );
        }