Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jQuery(".selector").click Throws Exception if Collection Empty #53

Open
mhemesath opened this issue Jul 12, 2011 · 0 comments
Open

jQuery(".selector").click Throws Exception if Collection Empty #53

mhemesath opened this issue Jul 12, 2011 · 0 comments

Comments

@mhemesath
Copy link
Contributor

If no nodes exist that match .foo then

browser.jQuery(".foo").click(func);

will result in an exception, because https://github.com/LearnBoost/tobi/blob/master/lib/jquery/index.js#L89 is expecting a node to exist.

The nodeName should default to an empty String and only set the nodeName if a node exists in the jQuery object. That way the switch statement will break and continue to line 116 where a more useful error message will be thrown.

Not a huge issue, but one I ran into a little bit while writing tests.

I'll try to get to this sometime this week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant