X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fcore.js;h=07d5caf579a09ed42b47171578757834fd3428af;hb=fb6c038bf00296480234c971a1664ac01ca1479e;hp=8940ada2bdf37aec3a7296d2dc38ccb852c5c27e;hpb=fb48ae8e6cca25fd29ef2b1eb23e9efa7b0eef7c;p=jquery.git diff --git a/src/core.js b/src/core.js index 8940ada..07d5caf 100644 --- a/src/core.js +++ b/src/core.js @@ -215,7 +215,7 @@ jQuery.fn = jQuery.prototype = { this.toArray() : // Return just the object - ( num < 0 ? this.slice(num)[ 0 ] : this[ num ] ); + ( num < 0 ? this[ this.length + num ] : this[ num ] ); }, // Take an array of elements and push it onto the stack @@ -417,18 +417,21 @@ jQuery.extend({ // If there are functions bound, to execute if ( readyList ) { // Execute all of them - var fn, i = 0; - while ( (fn = readyList[ i++ ]) ) { - fn.call( document, jQuery ); - } + var fn, + i = 0, + ready = readyList; // Reset the list of functions readyList = null; - } - // Trigger any bound ready events - if ( jQuery.fn.trigger ) { - jQuery( document ).trigger( "ready" ).unbind( "ready" ); + while ( (fn = ready[ i++ ]) ) { + fn.call( document, jQuery ); + } + + // Trigger any bound ready events + if ( jQuery.fn.trigger ) { + jQuery( document ).trigger( "ready" ).unbind( "ready" ); + } } } }, @@ -529,6 +532,12 @@ jQuery.extend({ }, isEmptyObject: function( obj ) { + + // Fixes #7413 Check to see if obj passes isPlainObject + if ( !jQuery.isPlainObject( obj ) ) { + return false; + } + for ( var name in obj ) { return false; }