Skip to content
Permalink
Browse files

2.0: Reduce globalEval

Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
  • Loading branch information
rwaldron committed Dec 17, 2012
1 parent 155dbad commit f300c5c2f33641d56f467807b1389c928144d4a2
Showing with 3 additions and 9 deletions.
  1. +3 −9 src/core.js
@@ -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 + ";" );
}
},

0 comments on commit f300c5c

Please sign in to comment.
You can’t perform that action at this time.