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

[Merged by Bors] - Add URI encoding and decoding functions #2267

Closed
wants to merge 9 commits into from
Closed

Conversation

Razican
Copy link
Member

@Razican Razican commented Sep 5, 2022

This Pull Request closes #894.

It changes the following:

Things to discuss:

  • I'm unable to find in the spec information regarding the only failing tests, which relate to this:

    If string.charAt(k) in [0xDC00 - 0xDFFF], throw URIError

Let me know your thoughts :)

@Razican Razican added enhancement New feature or request builtins PRs and Issues related to builtins/intrinsics labels Sep 5, 2022
@Razican Razican added this to the v0.16.0 milestone Sep 5, 2022
@github-actions
Copy link

github-actions bot commented Sep 5, 2022

Test262 conformance changes

VM implementation

Test result main count PR count difference
Total 91,827 91,827 0
Passed 65,916 66,244 +328
Ignored 16,672 16,672 0
Failed 9,239 8,911 -,328
Panics 0 0 0
Conformance 71.78% 72.14% +0.36%
Fixed tests (328):
test/built-ins/decodeURI/S15.1.3.1_A1.13_T2.js [strict mode] (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A1.13_T2.js (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A1.12_T3.js [strict mode] (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A1.12_T3.js (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A2.3_T1.js [strict mode] (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A2.3_T1.js (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A1.9_T2.js [strict mode] (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A1.9_T2.js (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A4_T2.js [strict mode] (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A4_T2.js (previously Failed)
test/built-ins/decodeURI/prop-desc.js [strict mode] (previously Failed)
test/built-ins/decodeURI/prop-desc.js (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A5.6.js [strict mode] (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A5.6.js (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A3_T2.js [strict mode] (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A3_T2.js (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A3_T3.js [strict mode] (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A3_T3.js (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A1.9_T3.js [strict mode] (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A1.9_T3.js (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A1.11_T1.js [strict mode] (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A1.11_T1.js (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A5.4.js [strict mode] (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A5.4.js (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A1.15_T5.js [strict mode] (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A1.15_T5.js (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A1.14_T4.js [strict mode] (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A1.14_T4.js (previously Failed)
test/built-ins/decodeURI/not-a-constructor.js [strict mode] (previously Failed)
test/built-ins/decodeURI/not-a-constructor.js (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A1.15_T6.js [strict mode] (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A1.15_T6.js (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A5.7.js [strict mode] (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A5.7.js (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A1.3_T1.js [strict mode] (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A1.3_T1.js (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A1.14_T2.js [strict mode] (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A1.14_T2.js (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A1.12_T1.js [strict mode] (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A1.12_T1.js (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A1.7_T1.js [strict mode] (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A1.7_T1.js (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A5.1.js [strict mode] (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A5.1.js (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A1.8_T2.js [strict mode] (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A1.8_T2.js (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A2.2_T1.js [strict mode] (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A2.2_T1.js (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A1.10_T1.js [strict mode] (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A1.10_T1.js (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A2.5_T1.js [strict mode] (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A2.5_T1.js (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A1.14_T1.js [strict mode] (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A1.14_T1.js (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A1.15_T2.js [strict mode] (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A1.15_T2.js (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A4_T3.js [strict mode] (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A4_T3.js (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A1.2_T2.js [strict mode] (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A1.2_T2.js (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A1.15_T4.js [strict mode] (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A1.15_T4.js (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A1.5_T1.js [strict mode] (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A1.5_T1.js (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A4_T1.js [strict mode] (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A4_T1.js (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A1.15_T1.js [strict mode] (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A1.15_T1.js (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A1.15_T3.js [strict mode] (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A1.15_T3.js (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A1.4_T1.js [strict mode] (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A1.4_T1.js (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A1.13_T1.js [strict mode] (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A1.13_T1.js (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A6_T1.js [strict mode] (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A6_T1.js (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A4_T4.js [strict mode] (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A4_T4.js (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A1.2_T1.js [strict mode] (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A1.2_T1.js (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A1.1_T1.js [strict mode] (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A1.1_T1.js (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A5.2.js [strict mode] (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A5.2.js (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A1.12_T2.js [strict mode] (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A1.12_T2.js (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A5.3.js [strict mode] (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A5.3.js (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A2.4_T1.js [strict mode] (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A2.4_T1.js (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A1.3_T2.js [strict mode] (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A1.3_T2.js (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A1.9_T1.js [strict mode] (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A1.9_T1.js (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A2.1_T1.js [strict mode] (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A2.1_T1.js (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A1.14_T3.js [strict mode] (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A1.14_T3.js (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A3_T1.js [strict mode] (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A3_T1.js (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A1.11_T2.js [strict mode] (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A1.11_T2.js (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A1.8_T1.js [strict mode] (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A1.8_T1.js (previously Failed)
test/built-ins/decodeURI/name.js [strict mode] (previously Failed)
test/built-ins/decodeURI/name.js (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A1.6_T1.js [strict mode] (previously Failed)
test/built-ins/decodeURI/S15.1.3.1_A1.6_T1.js (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A3_T1.js [strict mode] (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A3_T1.js (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A1.5_T1.js [strict mode] (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A1.5_T1.js (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A1.14_T2.js [strict mode] (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A1.14_T2.js (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A2.4_T1.js [strict mode] (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A2.4_T1.js (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A4_T2.js [strict mode] (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A4_T2.js (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A1.14_T1.js [strict mode] (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A1.14_T1.js (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A1.8_T2.js [strict mode] (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A1.8_T2.js (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A1.14_T3.js [strict mode] (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A1.14_T3.js (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A6_T1.js [strict mode] (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A6_T1.js (previously Failed)
test/built-ins/decodeURIComponent/prop-desc.js [strict mode] (previously Failed)
test/built-ins/decodeURIComponent/prop-desc.js (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A1.15_T6.js [strict mode] (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A1.15_T6.js (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A1.11_T2.js [strict mode] (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A1.11_T2.js (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A1.15_T5.js [strict mode] (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A1.15_T5.js (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A1.11_T1.js [strict mode] (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A1.11_T1.js (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A1.9_T1.js [strict mode] (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A1.9_T1.js (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A5.3.js [strict mode] (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A5.3.js (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A1.9_T3.js [strict mode] (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A1.9_T3.js (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A5.1.js [strict mode] (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A5.1.js (previously Failed)
test/built-ins/decodeURIComponent/not-a-constructor.js [strict mode] (previously Failed)
test/built-ins/decodeURIComponent/not-a-constructor.js (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A3_T3.js [strict mode] (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A3_T3.js (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A4_T4.js [strict mode] (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A4_T4.js (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A1.3_T2.js [strict mode] (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A1.3_T2.js (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A2.5_T1.js [strict mode] (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A2.5_T1.js (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A1.15_T4.js [strict mode] (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A1.15_T4.js (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A1.7_T1.js [strict mode] (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A1.7_T1.js (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A1.9_T2.js [strict mode] (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A1.9_T2.js (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A5.2.js [strict mode] (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A5.2.js (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A1.13_T2.js [strict mode] (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A1.13_T2.js (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A1.1_T1.js [strict mode] (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A1.1_T1.js (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A1.15_T2.js [strict mode] (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A1.15_T2.js (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A1.12_T1.js [strict mode] (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A1.12_T1.js (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A1.6_T1.js [strict mode] (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A1.6_T1.js (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A3_T2.js [strict mode] (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A3_T2.js (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A1.14_T4.js [strict mode] (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A1.14_T4.js (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A4_T1.js [strict mode] (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A4_T1.js (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A5.6.js [strict mode] (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A5.6.js (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A5.7.js [strict mode] (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A5.7.js (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A4_T3.js [strict mode] (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A4_T3.js (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A1.10_T1.js [strict mode] (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A1.10_T1.js (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A2.1_T1.js [strict mode] (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A2.1_T1.js (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A1.13_T1.js [strict mode] (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A1.13_T1.js (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A1.2_T2.js [strict mode] (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A1.2_T2.js (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A1.15_T1.js [strict mode] (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A1.15_T1.js (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A1.2_T1.js [strict mode] (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A1.2_T1.js (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A2.2_T1.js [strict mode] (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A2.2_T1.js (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A1.12_T2.js [strict mode] (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A1.12_T2.js (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A1.12_T3.js [strict mode] (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A1.12_T3.js (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A1.8_T1.js [strict mode] (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A1.8_T1.js (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A5.4.js [strict mode] (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A5.4.js (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A1.4_T1.js [strict mode] (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A1.4_T1.js (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A1.3_T1.js [strict mode] (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A1.3_T1.js (previously Failed)
test/built-ins/decodeURIComponent/name.js [strict mode] (previously Failed)
test/built-ins/decodeURIComponent/name.js (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A1.15_T3.js [strict mode] (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A1.15_T3.js (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A2.3_T1.js [strict mode] (previously Failed)
test/built-ins/decodeURIComponent/S15.1.3.2_A2.3_T1.js (previously Failed)
test/built-ins/global/S10.2.3_A1.2_T2.js [strict mode] (previously Failed)
test/built-ins/global/S10.2.3_A1.2_T2.js (previously Failed)
test/built-ins/global/S10.2.3_A1.1_T2.js [strict mode] (previously Failed)
test/built-ins/global/S10.2.3_A1.1_T2.js (previously Failed)
test/built-ins/global/S10.2.3_A1.3_T2.js [strict mode] (previously Failed)
test/built-ins/global/S10.2.3_A1.3_T2.js (previously Failed)
test/built-ins/Object/getOwnPropertyDescriptor/15.2.3.3-4-9.js [strict mode] (previously Failed)
test/built-ins/Object/getOwnPropertyDescriptor/15.2.3.3-4-9.js (previously Failed)
test/built-ins/Object/getOwnPropertyDescriptor/15.2.3.3-4-11.js [strict mode] (previously Failed)
test/built-ins/Object/getOwnPropertyDescriptor/15.2.3.3-4-11.js (previously Failed)
test/built-ins/Object/getOwnPropertyDescriptor/15.2.3.3-4-10.js [strict mode] (previously Failed)
test/built-ins/Object/getOwnPropertyDescriptor/15.2.3.3-4-10.js (previously Failed)
test/built-ins/encodeURI/S15.1.3.3_A3.3_T1.js [strict mode] (previously Failed)
test/built-ins/encodeURI/S15.1.3.3_A3.3_T1.js (previously Failed)
test/built-ins/encodeURI/S15.1.3.3_A3.2_T3.js [strict mode] (previously Failed)
test/built-ins/encodeURI/S15.1.3.3_A3.2_T3.js (previously Failed)
test/built-ins/encodeURI/S15.1.3.3_A4_T3.js [strict mode] (previously Failed)
test/built-ins/encodeURI/S15.1.3.3_A4_T3.js (previously Failed)
test/built-ins/encodeURI/prop-desc.js [strict mode] (previously Failed)
test/built-ins/encodeURI/prop-desc.js (previously Failed)
test/built-ins/encodeURI/S15.1.3.3_A2.2_T1.js [strict mode] (previously Failed)
test/built-ins/encodeURI/S15.1.3.3_A2.2_T1.js (previously Failed)
test/built-ins/encodeURI/S15.1.3.3_A6_T1.js [strict mode] (previously Failed)
test/built-ins/encodeURI/S15.1.3.3_A6_T1.js (previously Failed)
test/built-ins/encodeURI/S15.1.3.3_A4_T2.js [strict mode] (previously Failed)
test/built-ins/encodeURI/S15.1.3.3_A4_T2.js (previously Failed)
test/built-ins/encodeURI/not-a-constructor.js [strict mode] (previously Failed)
test/built-ins/encodeURI/not-a-constructor.js (previously Failed)
test/built-ins/encodeURI/S15.1.3.3_A2.3_T1.js [strict mode] (previously Failed)
test/built-ins/encodeURI/S15.1.3.3_A2.3_T1.js (previously Failed)
test/built-ins/encodeURI/S15.1.3.3_A2.4_T1.js [strict mode] (previously Failed)
test/built-ins/encodeURI/S15.1.3.3_A2.4_T1.js (previously Failed)
test/built-ins/encodeURI/S15.1.3.3_A5.7.js [strict mode] (previously Failed)
test/built-ins/encodeURI/S15.1.3.3_A5.7.js (previously Failed)
test/built-ins/encodeURI/S15.1.3.3_A5.6.js [strict mode] (previously Failed)
test/built-ins/encodeURI/S15.1.3.3_A5.6.js (previously Failed)
test/built-ins/encodeURI/S15.1.3.3_A3.2_T1.js [strict mode] (previously Failed)
test/built-ins/encodeURI/S15.1.3.3_A3.2_T1.js (previously Failed)
test/built-ins/encodeURI/S15.1.3.3_A5.1.js [strict mode] (previously Failed)
test/built-ins/encodeURI/S15.1.3.3_A5.1.js (previously Failed)
test/built-ins/encodeURI/S15.1.3.3_A4_T1.js [strict mode] (previously Failed)
test/built-ins/encodeURI/S15.1.3.3_A4_T1.js (previously Failed)
test/built-ins/encodeURI/S15.1.3.3_A3.1_T1.js [strict mode] (previously Failed)
test/built-ins/encodeURI/S15.1.3.3_A3.1_T1.js (previously Failed)
test/built-ins/encodeURI/S15.1.3.3_A2.4_T2.js [strict mode] (previously Failed)
test/built-ins/encodeURI/S15.1.3.3_A2.4_T2.js (previously Failed)
test/built-ins/encodeURI/S15.1.3.3_A2.5_T1.js [strict mode] (previously Failed)
test/built-ins/encodeURI/S15.1.3.3_A2.5_T1.js (previously Failed)
test/built-ins/encodeURI/S15.1.3.3_A5.3.js [strict mode] (previously Failed)
test/built-ins/encodeURI/S15.1.3.3_A5.3.js (previously Failed)
test/built-ins/encodeURI/S15.1.3.3_A3.2_T2.js [strict mode] (previously Failed)
test/built-ins/encodeURI/S15.1.3.3_A3.2_T2.js (previously Failed)
test/built-ins/encodeURI/S15.1.3.3_A2.1_T1.js [strict mode] (previously Failed)
test/built-ins/encodeURI/S15.1.3.3_A2.1_T1.js (previously Failed)
test/built-ins/encodeURI/S15.1.3.3_A5.4.js [strict mode] (previously Failed)
test/built-ins/encodeURI/S15.1.3.3_A5.4.js (previously Failed)
test/built-ins/encodeURI/S15.1.3.3_A4_T4.js [strict mode] (previously Failed)
test/built-ins/encodeURI/S15.1.3.3_A4_T4.js (previously Failed)
test/built-ins/encodeURI/name.js [strict mode] (previously Failed)
test/built-ins/encodeURI/name.js (previously Failed)
test/built-ins/encodeURI/S15.1.3.3_A5.2.js [strict mode] (previously Failed)
test/built-ins/encodeURI/S15.1.3.3_A5.2.js (previously Failed)
test/built-ins/encodeURIComponent/S15.1.3.4_A5.4.js [strict mode] (previously Failed)
test/built-ins/encodeURIComponent/S15.1.3.4_A5.4.js (previously Failed)
test/built-ins/encodeURIComponent/S15.1.3.4_A4_T4.js [strict mode] (previously Failed)
test/built-ins/encodeURIComponent/S15.1.3.4_A4_T4.js (previously Failed)
test/built-ins/encodeURIComponent/prop-desc.js [strict mode] (previously Failed)
test/built-ins/encodeURIComponent/prop-desc.js (previously Failed)
test/built-ins/encodeURIComponent/not-a-constructor.js [strict mode] (previously Failed)
test/built-ins/encodeURIComponent/not-a-constructor.js (previously Failed)
test/built-ins/encodeURIComponent/S15.1.3.4_A3.2_T2.js [strict mode] (previously Failed)
test/built-ins/encodeURIComponent/S15.1.3.4_A3.2_T2.js (previously Failed)
test/built-ins/encodeURIComponent/S15.1.3.4_A2.2_T1.js [strict mode] (previously Failed)
test/built-ins/encodeURIComponent/S15.1.3.4_A2.2_T1.js (previously Failed)
test/built-ins/encodeURIComponent/S15.1.3.4_A2.1_T1.js [strict mode] (previously Failed)
test/built-ins/encodeURIComponent/S15.1.3.4_A2.1_T1.js (previously Failed)
test/built-ins/encodeURIComponent/S15.1.3.4_A3.3_T1.js [strict mode] (previously Failed)
test/built-ins/encodeURIComponent/S15.1.3.4_A3.3_T1.js (previously Failed)
test/built-ins/encodeURIComponent/S15.1.3.4_A4_T1.js [strict mode] (previously Failed)
test/built-ins/encodeURIComponent/S15.1.3.4_A4_T1.js (previously Failed)
test/built-ins/encodeURIComponent/S15.1.3.4_A5.3.js [strict mode] (previously Failed)
test/built-ins/encodeURIComponent/S15.1.3.4_A5.3.js (previously Failed)
test/built-ins/encodeURIComponent/S15.1.3.4_A5.6.js [strict mode] (previously Failed)
test/built-ins/encodeURIComponent/S15.1.3.4_A5.6.js (previously Failed)
test/built-ins/encodeURIComponent/S15.1.3.4_A4_T2.js [strict mode] (previously Failed)
test/built-ins/encodeURIComponent/S15.1.3.4_A4_T2.js (previously Failed)
test/built-ins/encodeURIComponent/S15.1.3.4_A3.1_T1.js [strict mode] (previously Failed)
test/built-ins/encodeURIComponent/S15.1.3.4_A3.1_T1.js (previously Failed)
test/built-ins/encodeURIComponent/S15.1.3.4_A2.3_T1.js [strict mode] (previously Failed)
test/built-ins/encodeURIComponent/S15.1.3.4_A2.3_T1.js (previously Failed)
test/built-ins/encodeURIComponent/S15.1.3.4_A5.1.js [strict mode] (previously Failed)
test/built-ins/encodeURIComponent/S15.1.3.4_A5.1.js (previously Failed)
test/built-ins/encodeURIComponent/S15.1.3.4_A5.2.js [strict mode] (previously Failed)
test/built-ins/encodeURIComponent/S15.1.3.4_A5.2.js (previously Failed)
test/built-ins/encodeURIComponent/S15.1.3.4_A3.2_T3.js [strict mode] (previously Failed)
test/built-ins/encodeURIComponent/S15.1.3.4_A3.2_T3.js (previously Failed)
test/built-ins/encodeURIComponent/S15.1.3.4_A5.7.js [strict mode] (previously Failed)
test/built-ins/encodeURIComponent/S15.1.3.4_A5.7.js (previously Failed)
test/built-ins/encodeURIComponent/S15.1.3.4_A4_T3.js [strict mode] (previously Failed)
test/built-ins/encodeURIComponent/S15.1.3.4_A4_T3.js (previously Failed)
test/built-ins/encodeURIComponent/S15.1.3.4_A2.4_T2.js [strict mode] (previously Failed)
test/built-ins/encodeURIComponent/S15.1.3.4_A2.4_T2.js (previously Failed)
test/built-ins/encodeURIComponent/S15.1.3.4_A3.2_T1.js [strict mode] (previously Failed)
test/built-ins/encodeURIComponent/S15.1.3.4_A3.2_T1.js (previously Failed)
test/built-ins/encodeURIComponent/S15.1.3.4_A2.5_T1.js [strict mode] (previously Failed)
test/built-ins/encodeURIComponent/S15.1.3.4_A2.5_T1.js (previously Failed)
test/built-ins/encodeURIComponent/name.js [strict mode] (previously Failed)
test/built-ins/encodeURIComponent/name.js (previously Failed)
test/built-ins/encodeURIComponent/S15.1.3.4_A2.4_T1.js [strict mode] (previously Failed)
test/built-ins/encodeURIComponent/S15.1.3.4_A2.4_T1.js (previously Failed)
test/built-ins/encodeURIComponent/S15.1.3.4_A6_T1.js [strict mode] (previously Failed)
test/built-ins/encodeURIComponent/S15.1.3.4_A6_T1.js (previously Failed)

@codecov
Copy link

codecov bot commented Sep 5, 2022

Codecov Report

Merging #2267 (2be3ca5) into main (b0025fc) will increase coverage by 0.09%.
The diff coverage is 12.40%.

@@            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     
Impacted Files Coverage Δ
boa_engine/src/builtins/mod.rs 13.04% <0.00%> (+1.10%) ⬆️
boa_engine/src/builtins/uri/consts.rs 0.00% <0.00%> (ø)
boa_engine/src/builtins/uri/mod.rs 9.09% <9.09%> (ø)
boa_engine/src/builtins/string/mod.rs 64.02% <60.00%> (+0.08%) ⬆️
boa_engine/src/builtins/regexp/mod.rs 67.01% <100.00%> (ø)
boa_engine/src/builtins/string/string_iterator.rs 88.46% <100.00%> (ø)
...syntax/parser/statement/iteration/for_statement.rs 37.15% <0.00%> (-2.38%) ⬇️
...engine/src/syntax/parser/expression/primary/mod.rs 35.40% <0.00%> (-1.39%) ⬇️
...engine/src/syntax/parser/statement/variable/mod.rs 44.77% <0.00%> (-0.94%) ⬇️
boa_engine/src/syntax/parser/statement/mod.rs 29.51% <0.00%> (-0.77%) ⬇️
... and 29 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Member

@raskad raskad left a 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 :)

boa_engine/src/builtins/uri/consts.rs Outdated Show resolved Hide resolved
boa_engine/src/builtins/uri/mod.rs Outdated Show resolved Hide resolved
boa_engine/src/builtins/uri/mod.rs Outdated Show resolved Hide resolved
boa_engine/src/builtins/uri/mod.rs Outdated Show resolved Hide resolved
boa_engine/src/builtins/uri/mod.rs Outdated Show resolved Hide resolved
boa_engine/src/builtins/uri/mod.rs Outdated Show resolved Hide resolved
boa_engine/src/builtins/uri/mod.rs Outdated Show resolved Hide resolved
boa_engine/src/builtins/uri/mod.rs Outdated Show resolved Hide resolved
@jedel1043
Copy link
Member

The failing tests are probably related to the abstract operation Encode:

i. Let cp be CodePointAt(string, k).
ii. If cp.[[IsUnpairedSurrogate]] is true, throw a URIError exception.

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

@Razican
Copy link
Member Author

Razican commented Sep 6, 2022

The failing tests are probably related to the abstract operation Encode:

i. Let cp be CodePointAt(string, k).
ii. If cp.[[IsUnpairedSurrogate]] is true, throw a URIError exception.

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 CodePointAt implementation.

@Razican
Copy link
Member Author

Razican commented Sep 6, 2022

The failing tests are probably related to the abstract operation Encode:

i. Let cp be CodePointAt(string, k).
ii. If cp.[[IsUnpairedSurrogate]] is true, throw a URIError exception.

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

It turns out that the issue is in the String.fromCharCode(...codeUnits) function. Here, we convert the code units list to a std::String, which, for these cases, since the used characters are unpaired surrogates, it converts them to the UTF replacement character, and this then makes the rest fail.

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.

Copy link
Member

@raskad raskad left a 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!

Copy link
Member

@jedel1043 jedel1043 left a 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!

boa_engine/src/builtins/uri/consts.rs Outdated Show resolved Hide resolved
boa_engine/src/builtins/uri/consts.rs Show resolved Hide resolved
boa_engine/src/builtins/uri/mod.rs Outdated Show resolved Hide resolved
Copy link
Member

@jedel1043 jedel1043 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@raskad
Copy link
Member

raskad commented Sep 18, 2022

bors r+

bors bot pushed a commit that referenced this pull request Sep 18, 2022
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>
@bors
Copy link

bors bot commented Sep 18, 2022

Pull request successfully merged into main.

Build succeeded:

@bors bors bot changed the title Add URI encoding and decoding functions [Merged by Bors] - Add URI encoding and decoding functions Sep 18, 2022
@bors bors bot closed this Sep 18, 2022
@bors bors bot deleted the uri branch September 18, 2022 02:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
builtins PRs and Issues related to builtins/intrinsics enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement URI Handling Functions
4 participants