Fix for a selector speed regression (calling a simple selector many times resulted...
[jquery.git] / src / event / event.js
index bb5f9d2..23dbd6f 100644 (file)
@@ -161,7 +161,7 @@ jQuery.event = {
                // Empty object is for triggered events with no data
                event = jQuery.event.fix( event || window.event || {} ); 
 
-               var c = this.$events && this.$events[event.type], args = [].slice.call( arguments, 1 );
+               var c = this.$events && this.$events[event.type], args = Array.prototype.slice.call( arguments, 1 );
                args.unshift( event );
 
                for ( var j in c ) {
@@ -196,14 +196,14 @@ jQuery.event = {
                event.preventDefault = function() {
                        // if preventDefault exists run it on the original event
                        if (originalEvent.preventDefault)
-                               return originalEvent.preventDefault();
+                               originalEvent.preventDefault();
                        // otherwise set the returnValue property of the original event to false (IE)
                        originalEvent.returnValue = false;
                };
                event.stopPropagation = function() {
                        // if stopPropagation exists run it on the original event
                        if (originalEvent.stopPropagation)
-                               return originalEvent.stopPropagation();
+                               originalEvent.stopPropagation();
                        // otherwise set the cancelBubble property of the original event to true (IE)
                        originalEvent.cancelBubble = true;
                };
@@ -578,8 +578,6 @@ jQuery.extend({
        }
 });
 
-new function(){
-
        /**
         * Bind a function to the scroll event of each matched element.
         *
@@ -976,5 +974,3 @@ new function(){
 
        // A fallback to window.onload, that will always work
        jQuery.event.add( window, "load", jQuery.ready );
-       
-};