diff options
author | Richard Gibson <richard.gibson@gmail.com> | 2017-11-22 14:43:44 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-22 14:43:44 -0500 |
commit | 0aa832afec04215ed5e14b1cc5fc287ad7939792 (patch) | |
tree | 85343c4c37db60fc7b28bb023aa4442db95dc69b /src/manipulation.js | |
parent | 60cc6c9fbf9188eb3ce45f0cd97e8af7f9f54263 (diff) | |
download | jquery-0aa832afec04215ed5e14b1cc5fc287ad7939792.tar.gz jquery-0aa832afec04215ed5e14b1cc5fc287ad7939792.zip |
Manipulation: Reduce size by eliminating single-use variable
Closes gh-3851
Diffstat (limited to 'src/manipulation.js')
-rw-r--r-- | src/manipulation.js | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/manipulation.js b/src/manipulation.js index 2db1cfe3f..c30100ff8 100644 --- a/src/manipulation.js +++ b/src/manipulation.js @@ -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" ); } |