Skip to content

Commit 07866a0

Browse files
mikesherovdmethvin
authored andcommitted
Fix #10753. Inline evalScript as it's only used in one place
1 parent e452ebd commit 07866a0

File tree

1 file changed

+15
-17
lines changed

1 file changed

+15
-17
lines changed

src/manipulation.js

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,21 @@ jQuery.fn.extend({
348348
}
349349

350350
if ( scripts.length ) {
351-
jQuery.each( scripts, evalScript );
351+
jQuery.each( scripts, function( i, elem ) {
352+
if ( elem.src ) {
353+
jQuery.ajax({
354+
url: elem.src,
355+
async: false,
356+
dataType: "script"
357+
});
358+
} else {
359+
jQuery.globalEval( ( elem.text || elem.textContent || elem.innerHTML || "" ).replace( rcleanScript, "/*$0*/" ) );
360+
}
361+
362+
if ( elem.parentNode ) {
363+
elem.parentNode.removeChild( elem );
364+
}
365+
});
352366
}
353367
}
354368

@@ -789,20 +803,4 @@ jQuery.extend({
789803
}
790804
});
791805

792-
function evalScript( i, elem ) {
793-
if ( elem.src ) {
794-
jQuery.ajax({
795-
url: elem.src,
796-
async: false,
797-
dataType: "script"
798-
});
799-
} else {
800-
jQuery.globalEval( ( elem.text || elem.textContent || elem.innerHTML || "" ).replace( rcleanScript, "/*$0*/" ) );
801-
}
802-
803-
if ( elem.parentNode ) {
804-
elem.parentNode.removeChild( elem );
805-
}
806-
}
807-
808806
})( jQuery );

0 commit comments

Comments
 (0)