X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fcore.js;h=cb9b528eca4d46b149bc0f947db4bc5acd691cb4;hb=26eda09892459709d224f910038b8f6836bfd012;hp=460a1dad205586ef3ca237470f3cbf6ffd00f60f;hpb=29ff710c9b02dee2c407b408ea88489b3cef688e;p=jquery.git diff --git a/src/core.js b/src/core.js index 460a1da..cb9b528 100644 --- a/src/core.js +++ b/src/core.js @@ -128,7 +128,9 @@ jQuery.fn = jQuery.prototype = { return this.length; }, - toArray: slice, + toArray: function(){ + return slice.call( this, 0 ); + }, // Get the Nth element in the matched element set OR // Get the whole matched element set as a clean array @@ -139,7 +141,7 @@ jQuery.fn = jQuery.prototype = { this.toArray() : // Return just the object - ( num < 0 ? this.toArray(num)[ 0 ] : this[ num ] ); + ( num < 0 ? this.slice(num)[ 0 ] : this[ num ] ); }, // Take an array of elements and push it onto the stack @@ -311,8 +313,7 @@ jQuery.extend({ // check if an element is in a (or is an) XML document isXMLDoc: function( elem ) { - return elem.nodeType === 9 && elem.documentElement.nodeName !== "HTML" || - !!elem.ownerDocument && elem.ownerDocument.documentElement.nodeName !== "HTML"; + return (elem.ownerDocument || elem).documentElement.nodeName !== "HTML"; }, // Evalulates a script in a global context