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

propagate syntax errors caused by invalid selectors #177

Merged
merged 1 commit into from
Mar 31, 2013

Conversation

davidchambers
Copy link
Contributor

No description provided.

@matthewmueller
Copy link
Member

hmm... not so sure about this one. the try-catch was implemented to fix some issues before.

Also, jquery fails silently. What about using something like: https://github.com/visionmedia/debug ?

@davidchambers
Copy link
Contributor Author

jquery fails silently

No, it doesn't. Try running this in the console:

> jQuery(':bah')
Error: Syntax error, unrecognized expression: unsupported pseudo: bah

the try-catch was implemented to fix some issues before

I'll look through the commit history to see when the try/catch was added.

@davidchambers
Copy link
Contributor Author

The try/catch was added in 8834eaa, but I don't understand why this was done. It seems unrelated to the rest of the commit.

All the tests pass (including those added in the aforementioned commit). Unless you can cite a specific reason for the try/catch to remain, Matt, I suggest we remove it.

@matthewmueller
Copy link
Member

Oh my bad, this is just in find? I was referring to stuff like this:

#59

I think they kind of relate though.

@davidchambers
Copy link
Contributor Author

This is just in find, yes. I'm suggesting that cheerio throw a SyntaxError when given an invalid selector (as jQuery does). All the tests pass (including the test added in #59, though I don't think that's related), so I think it's safe to make this correction.

matthewmueller added a commit that referenced this pull request Mar 31, 2013
propagate syntax errors caused by invalid selectors
@matthewmueller matthewmueller merged commit b30a081 into cheeriojs:master Mar 31, 2013
@matthewmueller
Copy link
Member

Okay cool. Yah I'll merge this. THanks!

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

Successfully merging this pull request may close these issues.

2 participants