git.asbjorn.biz
/
jquery.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
98e8ea3
)
Added test and check for end() when there is no stack or nothing on the stack to...
author
Jörn Zaefferer
<joern.zaefferer@gmail.com>
Tue, 7 Nov 2006 11:32:21 +0000
(11:32 +0000)
committer
Jörn Zaefferer
<joern.zaefferer@gmail.com>
Tue, 7 Nov 2006 11:32:21 +0000
(11:32 +0000)
src/jquery/jquery.js
patch
|
blob
|
history
diff --git
a/src/jquery/jquery.js
b/src/jquery/jquery.js
index
35a6ceb
..
567e6a0
100644
(file)
--- a/
src/jquery/jquery.js
+++ b/
src/jquery/jquery.js
@@
-944,12
+944,15
@@
jQuery.fn = jQuery.prototype = {
* @result $("p").find("span").end() == [ <p>...</p> ]
*
* @test ok( 'Yahoo' == $('#yahoo').parent().end().text(), 'Check for end' );
+ * ok( $('#yahoo').end(), 'Check for end with nothing to end' );
*
* @name end
* @type jQuery
* @cat DOM/Traversing
*/
end: function() {
+ if( !(this.stack && this.stack.length) )
+ return this;
return this.get( this.stack.pop() );
},