2.0: Reduce globalEval

Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
This commit is contained in:
Rick Waldron 2012-12-17 17:49:17 -05:00
parent 155dbad029
commit f300c5c2f3

View File

@ -504,16 +504,10 @@ jQuery.extend({
noop: function() {},
// Evaluates a script in a global context
// Workarounds based on findings by Jim Driscoll
// http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context
globalEval: function( data ) {
if ( data && jQuery.trim( data ) ) {
// We use execScript on Internet Explorer
// We use an anonymous function so that context is window
// rather than jQuery in Firefox
( window.execScript || function( data ) {
window[ "eval" ].call( window, data );
} )( data );
var indirect = eval;
if ( jQuery.trim( data ) ) {
indirect( data + ";" );
}
},