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 upImplement URLSearchParams.prototype.sort() #22638
Conversation
highfive
commented
Jan 6, 2019
|
Heads up! This PR modifies the following files:
|
|
r? @Manishearth |
|
Comments on the issue indicate they're thinking of the comparison algorithm in https://tc39.github.io/ecma262/#sec-abstract-relational-comparison , which is based on utf16 code units (not utf8) This implementation can either:
|
|
I doubt the performance of URLSearchParams.sort is particularly important, so I lean towards doing the less tricky thing. |
|
@jdm @Manishearth Thanks! I'll try to do the less tricky thing with comparing with |
|
@bors-servo try=wpt
|
Implement URLSearchParams.prototype.sort() --- - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #22545 - [x] There are tests for these changes <!-- 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/22638) <!-- Reviewable:end -->
|
|
There is no need to be tricky, though. Just use the standard library. a.chars().flat_map(char::decode_utf16).cmp(b.chars().flat_map(char::decode_utf16))Edit: this should use |
|
That won't work, |
|
Ah, maybe I should share the discussion with @nox on IRC earlier. So I think this PR is ready for review ? Ref: https://mozilla.logbot.info/servo/20190108#c15803031 cc @Manishearth |
|
Yes it is, and the code is correct. @bors-servo r+ |
|
|
Implement URLSearchParams.prototype.sort() --- - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #22545 - [x] There are tests for these changes <!-- 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/22638) <!-- Reviewable:end -->
|
|
|
@bors-servo retry
|
Implement URLSearchParams.prototype.sort() --- - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #22545 - [x] There are tests for these changes <!-- 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/22638) <!-- Reviewable:end -->
|
|
|
@bors-servo retry |
|
|
Implement URLSearchParams.prototype.sort() --- - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #22545 - [x] There are tests for these changes <!-- 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/22638) <!-- Reviewable:end -->
|
|
|
@bors-servo retry |
|
|
|
|
|
@bors-servo retry |
Implement URLSearchParams.prototype.sort() --- - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #22545 - [x] There are tests for these changes <!-- 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/22638) <!-- Reviewable:end -->
|
|
CYBAI commentedJan 6, 2019
•
edited by SimonSapin
./mach build -ddoes not report any errors./mach test-tidydoes not report any errorsThis change is