]> source.dussan.org Git - jquery.git/commitdiff
Removed uses of arguments.callee from jQuery.
authorJohn Resig <jeresig@gmail.com>
Tue, 8 Dec 2009 00:42:25 +0000 (16:42 -0800)
committerJohn Resig <jeresig@gmail.com>
Tue, 8 Dec 2009 00:42:25 +0000 (16:42 -0800)
src/core.js
src/event.js

index 26f6e924a6eed8b1ccd5d0bdb91ab74bfbc4710c..8c623632daf3f4b51427ef7d66ad19e916d5f79c 100644 (file)
@@ -373,8 +373,8 @@ jQuery.extend({
                // Mozilla, Opera and webkit nightlies currently support this event
                if ( document.addEventListener ) {
                        // Use the handy event callback
-                       document.addEventListener( "DOMContentLoaded", function() {
-                               document.removeEventListener( "DOMContentLoaded", arguments.callee, false );
+                       document.addEventListener( "DOMContentLoaded", function DOMContentLoaded() {
+                               document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );
                                jQuery.ready();
                        }, false );
                        
@@ -385,10 +385,10 @@ jQuery.extend({
                } else if ( document.attachEvent ) {
                        // ensure firing before onload,
                        // maybe late but safe also for iframes
-                       document.attachEvent("onreadystatechange", function() {
+                       document.attachEvent("onreadystatechange", function onreadystatechange() {
                                // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
                                if ( document.readyState === "complete" ) {
-                                       document.detachEvent( "onreadystatechange", arguments.callee );
+                                       document.detachEvent( "onreadystatechange", onreadystatechange );
                                        jQuery.ready();
                                }
                        });
@@ -405,7 +405,9 @@ jQuery.extend({
                        } catch(e){}
 
                        if ( document.documentElement.doScroll && toplevel ) {
-                               (function() {
+                               doScrollCheck();
+
+                               function doScrollCheck() {
                                        if ( jQuery.isReady ) {
                                                return;
                                        }
@@ -415,13 +417,13 @@ jQuery.extend({
                                                // http://javascript.nwbox.com/IEContentLoaded/
                                                document.documentElement.doScroll("left");
                                        } catch( error ) {
-                                               setTimeout( arguments.callee, 0 );
+                                               setTimeout( doScrollCheck, 1 );
                                                return;
                                        }
 
                                        // and execute any waiting functions
                                        jQuery.ready();
-                               })();
+                               }
                        }
                }
        },
index d59ef64dd062ebd49ba2f173b3b07e0627ca1e96..d2e106a6aca9b48320f4cab347805cfe0060073e 100644 (file)
@@ -37,11 +37,11 @@ jQuery.event = {
 
                // Init the element's event structure
                var events = jQuery.data( elem, "events" ) || jQuery.data( elem, "events", {} ),
-                       handle = jQuery.data( elem, "handle" ) || jQuery.data( elem, "handle", function() {
+                       handle = jQuery.data( elem, "handle" ) || jQuery.data( elem, "handle", function eventHandle() {
                                // Handle the second event of a trigger and when
                                // an event is called after a page has unloaded
                                return typeof jQuery !== "undefined" && !jQuery.event.triggered ?
-                                       jQuery.event.handle.apply( arguments.callee.elem, arguments ) :
+                                       jQuery.event.handle.apply( eventHandle.elem, arguments ) :
                                        undefined;
                        });
                // Add elem as a property of the handle function