]> source.dussan.org Git - jquery.git/commitdiff
Fixed two quick bugs from the JSLint overhaul.
authorJohn Resig <jeresig@gmail.com>
Tue, 16 May 2006 22:32:15 +0000 (22:32 +0000)
committerJohn Resig <jeresig@gmail.com>
Tue, 16 May 2006 22:32:15 +0000 (22:32 +0000)
jquery/jquery.js

index bd25ed2055a7401bebe16b8165167130e292ff6f..e9db33d1f777b0962e4b816c4e7ba418fc07bdba 100644 (file)
@@ -43,7 +43,7 @@ function $(a,c) {
                // The only two getters
                size: function() {return this.get().length;},
                get: function(i) {
-                       return i === null ? this.cur : this.cur[i];
+                       return typeof i == 'undefined' ? this.cur : this.cur[i];
                },
                
                each: function(f) {
@@ -620,7 +620,7 @@ $.filter = function(t,r,not) {
                        }
                                                
                        if ( f !== null ) {
-                               f = new Function('a','i','return ' + f);
+                               eval('f = function(a,i){return ' + f + '}');
                                r = g( r, f );
                        }
                }