Bug Tracker

Changeset 2834

Show
Ignore:
Timestamp:
08/22/07 06:19:22 (1 year ago)
Author:
jeresig
Message:

Fixed use of eval() and new Function() to work within the correct scope (and not throw errors).

Location:
trunk/jquery/src
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/jquery/src/jquery/jquery.js

    r2833 r2834  
    18581858        // for it (a handy shortcut) 
    18591859        if ( typeof fn == "string" ) 
    1860             fn = eval("function(a,i){return " + fn + "}"); 
     1860            fn = eval("false||function(a,i){return " + fn + "}"); 
    18611861 
    18621862        var result = []; 
     
    19121912        // for it (a handy shortcut) 
    19131913        if ( typeof fn == "string" ) 
    1914             fn = eval("function(a){return " + fn + "}"); 
     1914            fn = eval("false||function(a){return " + fn + "}"); 
    19151915 
    19161916        var result = []; 
  • trunk/jquery/src/selector/selector.js

    r2820 r2834  
    406406 
    407407                // Build a custom macro to enclose it 
    408                 eval("f = function(a,i){return " + f + "}"); 
     408                f = eval("false||function(a,i){return " + f + "}"); 
    409409 
    410410                // Execute it against the current filter