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

deepEqual should not crash on jQuery created objects #315

Closed
leobalter opened this issue Sep 7, 2012 · 3 comments
Closed

deepEqual should not crash on jQuery created objects #315

leobalter opened this issue Sep 7, 2012 · 3 comments

Comments

@leobalter
Copy link
Member

In Firefox 15 stable release (and also in the Nightly 18 version) I get a fail message on deepEqual assertions trying to compare jQuery objects like deepEqual( $( '<h3/>' ), $( '<h3/>' ) );

The fail message is: Died on test #1 @http://jsbin.com/oqiquw/1/edit:16 : toString.call(...).match(...) is null The error source:.objectType@http://code.jquery.com/qunit/qunit-git.js:760`

That works on Chrome (canary), Safari and Opera (next).

It can be a Firefox specific error. If it isn't know yet I can try a code fix and patch it.

Example:
http://jsbin.com/oqiquw/1/edit


Updating:

  • It works on Firefox 12.
  • It's not working on FF 14 and above
  • It doesn´t work on Safari 5.1.7, but it works on the new version of Safari
  • It doens´t work on Internet Explorer 9 (neither 7 and 8 via IE9 devTools)
  • It doesn´t work on iPhone´s Safari Browser (newest stable release)
@jzaefferer
Copy link
Member

Generally I recommend not to compare jQuery objects directly, instead looking at their underlying DOM objects. If there's just one element select: $("h3")[0], otherwise you could use the .get() method to retrieve an array of DOM elements.

Will look into handling jQuery objects properly though.

@leobalter
Copy link
Member Author

I know that's not a good pratice but that may lead to an error in
.deepEqual maybe in other kind of objects.

I'm going to try other examples to find out what's really the problem.

2012/9/13 Jörn Zaefferer notifications@github.com

Generally I recommend not to compare jQuery objects directly, instead
looking at their underlying DOM objects. If there's just one element
select: $("h3")[0], otherwise you could use the .get() method to retrieve
an array of DOM elements.

Will look into handling jQuery objects properly though.


Reply to this email directly or view it on GitHubhttps://github.com//issues/315#issuecomment-8525114.

@jzaefferer
Copy link
Member

Fixed the Firefox issue, where it died inside the objectType method. Still can't recommend comparing jQuery objects, as the diff output is pretty ugly when they're not equal.

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

No branches or pull requests

2 participants