Permalink
Browse files

Adding specs showing a problem while using find and the fix

  • Loading branch information...
1 parent e49239e commit 2bbdc2e0cab981a9fac20ccfd2fa351107ed884b @fabiomcosta fabiomcosta committed Feb 22, 2011
Showing with 2 additions and 1 deletion.
  1. +1 −0 SlickSpec/specs/mock_template.js
  2. +1 −1 Source/Slick.Finder.js
@@ -259,6 +259,7 @@ var specsMockTemplate = function(context){
it_should_find(44 , 'div.example,div.note');
it_should_find(1 , '#title');
+ it_should_find(0 , '#theres_no_such_id');
it_should_find(1 , 'h1#title');
it_should_find(1 , 'body #title');
@@ -250,7 +250,7 @@ var reSimpleSelector = /^([#.]?)((?:[\w-]+|\*))$/,
local.search = function(context, expression, append, first){
- var found = this.found = append || [];
+ var found = this.found = (first) ? null : (append || []);
if (!context) return found;
else if (context.navigator) context = context.document; // Convert the node from a window to a document

0 comments on commit 2bbdc2e

Please sign in to comment.