-
-
Notifications
You must be signed in to change notification settings - Fork 172
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
Possible JavaScript Breakage Between 4.1.0 and 4.4.0 #844
Comments
Thanks for the report - will have a look first guess - HtmlUnit/htmlunit-rhino-fork@caff4d9 |
Hi @tntim96, i guess this might be related to jour comperator impl
file1.file >= file2.file returns a boolean but the spec says you have to return 1/0/-1. The handling of boolean return values seems to be different between Chrome and FF - FF converts false to -1 and Chrome converts false to 0. The current HtmlUnit impl uses the chrome way for all browsers - i will fix that. |
@tntim96 have released a new snapshot but the changed behavior is only done for ff (liek the real browsers). Can you please fix your sort comperator impl and report if this solves the problem. |
Sort algorithm corrected and problem is gone. Thanks |
Happy to see, thanks for reporting this, another difference between FF and Chrome is now simulated by HtmlUnit. |
I was using HTMLUnit 4.1.0 waiting for #808 to be solved and have now swapped 4.4.0 to get the fix. I've noticed now that, with no other change to my code-base in JSCover, that a test is failing.
You can probably checkout the branch 'htmlunit-4.4.0' of JSCover and debug to see what's going on.
The test is
HtmlUnitUITest.shouldSortFilesByName
.I also tested with
4.5.0-SNAPSHOT
but got the same error.It's strange that a very similar test
HtmlUnitUITest.shouldSortFilesByCoverage
works.Modifying https://github.com/tntim96/JSCover/blob/5fbf74c65a85cbfaa59a2c3911d8509d13a0bafb/src/main/resources/jscoverage.js line 839 to add console output...the JavaScript sort code is
Output with HTMLUnit 4.4.0 is
...which looks wrong.
With HTML 4.1.0 it's
Which looks correct
The text was updated successfully, but these errors were encountered: