From 1a7f72e7fe96654838074f88c79e021d37c5c30a Mon Sep 17 00:00:00 2001 From: Yehuda Katz Date: Fri, 17 Jul 2009 17:33:44 +0000 Subject: Add test for jQuery(jQueryObj) cloning and simplify new get() code --- src/core.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/core.js b/src/core.js index 267bc104f..a74f0fec9 100644 --- a/src/core.js +++ b/src/core.js @@ -43,9 +43,8 @@ jQuery.fn = jQuery.prototype = { // Handle $(DOMElement) if ( selector.nodeType ) { - this[0] = selector; + this.context = this[0] = selector; this.length++; - this.context = selector; return this; } @@ -132,7 +131,7 @@ jQuery.fn = jQuery.prototype = { this.toArray() : // Return just the object - ( num < 0 ? this.toArray.call(this, num)[0] : this[ num ] ); + ( num < 0 ? this.toArray(num)[ 0 ] : this[ num ] ); }, // Take an array of elements and push it onto the stack -- cgit v1.2.3