aboutsummaryrefslogtreecommitdiffstats
path: root/src/core.js
diff options
context:
space:
mode:
authorRick Waldron <waldron.rick@gmail.com>2012-12-17 17:49:17 -0500
committerRick Waldron <waldron.rick@gmail.com>2012-12-26 13:34:37 -0500
commitf300c5c2f33641d56f467807b1389c928144d4a2 (patch)
tree5d2ebb043840ba3e3370fbc09cab6fe314759c6a /src/core.js
parent155dbad029e001f4752a4aedc901cf950ebfe64d (diff)
downloadjquery-f300c5c2f33641d56f467807b1389c928144d4a2.tar.gz
jquery-f300c5c2f33641d56f467807b1389c928144d4a2.zip
2.0: Reduce globalEval
Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
Diffstat (limited to 'src/core.js')
-rw-r--r--src/core.js12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/core.js b/src/core.js
index 55ed4317f..5661a4e7a 100644
--- a/src/core.js
+++ b/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 + ";" );
}
},