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

Fox for Issue #165 - Fixed IE compatibility issues with using toString on NodeList objects #166

Merged
merged 1 commit into from
Oct 10, 2011

Conversation

trevorparscal
Copy link
Contributor

In some browsers results in [object Object] rather than [object NodeList]. Now using duck typing for NodeList objects based on the presence of length, length being a number, presence of item method (which will be typeof string in IE and function in others, so we just check that it's not undefined) and that item(0) returns the same value as [0], unless it's empty, in which case item(0) will return null, while [0] would return undefined. Tested in IE6, IE8, Firefox 6, Safari 5 and Chrome 16.

which in some browsers results in [object Object] rather than [object
NodeList]. Now using duck typing for NodeList objects based on the
presence of length, length being a number, presence of item method
(which will be typeof string in IE and function in others, so we just
check that it's not undefined) and that item(0) returns the same value
as [0], unless it's empty, in which case item(0) will return 0, while
[0] would return undefined. Tested in IE6, IE8, Firefox 6, Safari 5 and
Chrome 16.
@jzaefferer jzaefferer merged commit 3fee197 into qunitjs:master Oct 10, 2011
@jzaefferer
Copy link
Member

Thanks. Had to manually merge this to resolve the conflict the the toString commit though: aa21c98

@jzaefferer
Copy link
Member

Btw. looking good: http://swarm.jquery.org/job/236/
That one failure is unrelated: #155 (though you're welcome to take a look at that as well; just update your branch to latest master first)

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