]> source.dussan.org Git - jquery.git/commitdiff
2.0: Reduce globalEval
authorRick Waldron <waldron.rick@gmail.com>
Mon, 17 Dec 2012 22:49:17 +0000 (17:49 -0500)
committerRick Waldron <waldron.rick@gmail.com>
Wed, 26 Dec 2012 18:34:37 +0000 (13:34 -0500)
Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
src/core.js

index 55ed4317f4b8cbf5353cfbbfbe6f1f602e6fccba..5661a4e7a7a1231f639031cdda48e42f497107de 100644 (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 + ";" );
                }
        },