Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign uplocaleCompare() doesn't return the expected value #13788
Comments
|
Hi, thanks for reporting this :) |
|
We never call |
|
Assigned to @emilio for investigation |
|
This is not a bug, SpiderMonkey by default (in From the ECMA spec this is completely valid:
So I'm closing this, feel free to reopen if anyone disagrees with this diagnostic :) |
|
I don't agree. The result of the comparison should be in the range {-1, 0, +1} http://www.w3schools.com/jsref/jsref_localecompare.asp |
|
Hmm... Ok, so this is spec compliant (because the spec only requires to define a total order), and the current behavior is the same of That being said, since nobody else does this, I guess it makes sense to switch. Seems like the easiest way to get this working is compiling SM with @jdm, @Ms2ger, do you think that's reasonable? I can try to do that tomorrow, I guess. |
|
Seems reasonable. |
See servo/servo#13788. I've tried a Servo build with this and have seen no problem, and now stuff like localeCompare do the right thing.
Build with intl API. See servo/servo#13788. I've tried a Servo build with this and have seen no problem, and now stuff like localeCompare do the right thing. r? @jdm <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/mozjs/107) <!-- Reviewable:end -->
Update mozjs_sys to expose proper locale callbacks. <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #13788 (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> Fixes #13788 <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13836) <!-- Reviewable:end -->
Update mozjs_sys to expose proper locale callbacks. <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #13788 (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> Fixes #13788 <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13836) <!-- Reviewable:end -->
Update mozjs_sys to expose proper locale callbacks. <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #13788 (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> Fixes #13788 <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13836) <!-- Reviewable:end -->
Update mozjs_sys to expose proper locale callbacks. <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #13788 (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> Fixes #13788 <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13836) <!-- Reviewable:end -->
Update mozjs_sys to expose proper locale callbacks. <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #13788 (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> Fixes #13788 <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13836) <!-- Reviewable:end -->
Minimal example:
var b = "aZ";
var a= "ab"
var ret = b.localeCompare(a); // returns -8 on Samsung Internet for Android 4.0