Skip to content

Commit

Permalink
Fix failing test after implementing .not()
Browse files Browse the repository at this point in the history
Also fix copy/paste oversight in tests

Safari thinks typeOf NodeList == function
Chrome thinks typeof NodeList == Object
  • Loading branch information
ekhaled committed Feb 28, 2011
1 parent 04cf455 commit 37d2ed6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/zepto.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ var Zepto = (function() {
},
not: function(selector){
var nodes=[];
if (typeof selector == 'function'){
if (typeof selector == 'function' && selector.call !== undefined){
this.each(function(idx){
if (!selector.call(this,idx)) nodes.push(this);
});
Expand Down
2 changes: 1 addition & 1 deletion test/zepto.html
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ <h1>Zepto DOM unit tests</h1>
t.assertLength(0,$("li span.e",el).siblings());
},

testSiblings: function(t){
testNot: function(t){
var el=$("#notTest");

//selector form
Expand Down

0 comments on commit 37d2ed6

Please sign in to comment.