Shortens slice expression in channel helpers as per rwaldron's suggestion.

This commit is contained in:
jaubourg 2011-05-24 17:27:05 +02:00
parent 96b0089c9c
commit 8c39fc855e

View file

@ -5,7 +5,8 @@
publish: "fire", publish: "fire",
subscribe: "add", subscribe: "add",
unsubscribe: "remove" unsubscribe: "remove"
}; },
sliceChannel = [].slice;
jQuery.Channel = function( name ) { jQuery.Channel = function( name ) {
var callbacks, var callbacks,
@ -27,7 +28,7 @@
jQuery.each( channelMethods, function( method ) { jQuery.each( channelMethods, function( method ) {
jQuery[ method ] = function( name ) { jQuery[ method ] = function( name ) {
var channel = jQuery.Channel( name ); var channel = jQuery.Channel( name );
channel[ method ].apply( channel, Array.prototype.slice.call( arguments, 1 ) ); channel[ method ].apply( channel, sliceChannel.call( arguments, 1 ) );
}; };
}); });