Skip to content
Browse files

Fix #10753. Inline evalScript as it's only used in one place

  • Loading branch information...
1 parent e452ebd commit 07866a04ddcac0b912cd0a7e382fea8667b32d0e @mikesherov mikesherov committed with dmethvin
Showing with 15 additions and 17 deletions.
  1. +15 −17 src/manipulation.js
View
32 src/manipulation.js
@@ -348,7 +348,21 @@ jQuery.fn.extend({
}
if ( scripts.length ) {
- jQuery.each( scripts, evalScript );
+ jQuery.each( scripts, function( i, elem ) {
+ if ( elem.src ) {
+ jQuery.ajax({
+ url: elem.src,
+ async: false,
+ dataType: "script"
+ });
+ } else {
+ jQuery.globalEval( ( elem.text || elem.textContent || elem.innerHTML || "" ).replace( rcleanScript, "/*$0*/" ) );
+ }
+
+ if ( elem.parentNode ) {
+ elem.parentNode.removeChild( elem );
+ }
+ });
}
}
@@ -789,20 +803,4 @@ jQuery.extend({
}
});
-function evalScript( i, elem ) {
- if ( elem.src ) {
- jQuery.ajax({
- url: elem.src,
- async: false,
- dataType: "script"
- });
- } else {
- jQuery.globalEval( ( elem.text || elem.textContent || elem.innerHTML || "" ).replace( rcleanScript, "/*$0*/" ) );
- }
-
- if ( elem.parentNode ) {
- elem.parentNode.removeChild( elem );
- }
-}
-
})( jQuery );

0 comments on commit 07866a0

Please sign in to comment.
Something went wrong with that request. Please try again.