Skip to content
Permalink
Browse files
Fixed use of eval() and new Function() to work within the correct sco…
…pe (and not throw errors).
  • Loading branch information
jeresig committed Aug 22, 2007
1 parent fc3e180 commit f2f399dcd552e73f68c9e8adfe26ef7995724cb3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
@@ -1857,7 +1857,7 @@ jQuery.extend({
// If a string is passed in for the function, make a function
// for it (a handy shortcut)
if ( typeof fn == "string" )
fn = eval("function(a,i){return " + fn + "}");
fn = eval("false||function(a,i){return " + fn + "}");

var result = [];

@@ -1911,7 +1911,7 @@ jQuery.extend({
// If a string is passed in for the function, make a function
// for it (a handy shortcut)
if ( typeof fn == "string" )
fn = eval("function(a){return " + fn + "}");
fn = eval("false||function(a){return " + fn + "}");

var result = [];

@@ -405,7 +405,7 @@ jQuery.extend({
f = jQuery.expr[m[1]][m[2]];

// Build a custom macro to enclose it
eval("f = function(a,i){return " + f + "}");
f = eval("false||function(a,i){return " + f + "}");

// Execute it against the current filter
r = jQuery.grep( r, f, not );

0 comments on commit f2f399d

Please sign in to comment.