-
-
Notifications
You must be signed in to change notification settings - Fork 406
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
[Merged by Bors] - Add URI encoding and decoding functions #2267
Conversation
Test262 conformance changesVM implementation
Fixed tests (328):
|
Codecov Report
@@ Coverage Diff @@
## main #2267 +/- ##
==========================================
+ Coverage 41.30% 41.40% +0.09%
==========================================
Files 234 237 +3
Lines 22018 22218 +200
==========================================
+ Hits 9095 9199 +104
- Misses 12923 13019 +96
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left some ideas and nitpicks.
The DC00—DFFF
range seem to be surrogates, but I'm not sure where exactly we miss something here.
I think switching to ranges in the reserved sets is probably a good idea, but not that imporant. We could always do that later.
Really nice to get these functions done, great work :)
The failing tests are probably related to the abstract operation
It was probably changed between spec editions, but the intent seems to be the same: rejecting URIs with unpaired surrogates. Having said that, fixing that test is probably blocked by #1659 |
I'm checking this, the issue might be with the |
It turns out that the issue is in the I guess that not using Rust string as the backend storage would solve this (and many other issues). So we should try to implement the full UTF-16 support. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work. Nice addition of the documentation to the codepoints functions!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The implementation looks good!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
bors r+ |
This Pull Request closes #894. It changes the following: - Adds the `encodeURI()`, `decodeURI()`, `encodeURIComponent()` and `decodeURIComponent()` functions - Passes all the tests except for those depending on #1987 or on the comment below. Things to discuss: - I'm unable to find in the spec information regarding the only failing tests, which relate to [this](https://github.com/tc39/test262/blob/f1870753fa616261193b99f79d996889921b3404/test/built-ins/encodeURI/S15.1.3.3_A1.1_T2.js): > If string.charAt(k) in [0xDC00 - 0xDFFF], throw URIError Let me know your thoughts :) Co-authored-by: raskad <32105367+raskad@users.noreply.github.com>
Pull request successfully merged into main. Build succeeded: |
This Pull Request closes #894.
It changes the following:
encodeURI()
,decodeURI()
,encodeURIComponent()
anddecodeURIComponent()
functionsThings to discuss:
Let me know your thoughts :)