Skip to content

fix TextDecoder label parsing#5162

Merged
jedel1043 merged 2 commits intoboa-dev:mainfrom
Monti-27:textdecoder-labels
Mar 19, 2026
Merged

fix TextDecoder label parsing#5162
jedel1043 merged 2 commits intoboa-dev:mainfrom
Monti-27:textdecoder-labels

Conversation

@Monti-27
Copy link
Contributor

Fixes #5135.

This makes TextDecoder normalize supported encoding labels before matching them.

It now accepts supported labels with ASCII case differences, surrounding ASCII whitespace, and the supported aliases for the UTF-8 and UTF-16 encodings Boa currently implements.

Tests:

  • cargo test -p boa_runtime text --lib
  • cargo test -p boa_runtime --lib
  • cargo clippy -p boa_runtime --all-features --all-targets -- -D warnings

@Monti-27 Monti-27 requested a review from a team as a code owner March 19, 2026 13:57
@github-actions github-actions bot added the Waiting On Review Waiting on reviews from the maintainers label Mar 19, 2026
@github-actions github-actions bot added this to the v1.0.0 milestone Mar 19, 2026
@github-actions github-actions bot added C-Tests Issues and PRs related to the tests. C-Builtins PRs and Issues related to builtins/intrinsics C-Runtime Issues and PRs related to Boa's runtime features labels Mar 19, 2026
@github-actions
Copy link

Test262 conformance changes

Test result main count PR count difference
Total 52,963 52,963 0
Passed 50,079 50,079 0
Ignored 2,072 2,072 0
Failed 812 812 0
Panics 0 0 0
Conformance 94.55% 94.55% 0.00%

Tested main commit: dd1efc2cef0868102f9e29cc9d05960c8283046b
Tested PR commit: 6bb998b1a73b1420bea8282ff770876ee001e91f
Compare commits: dd1efc2...6bb998b

@codecov
Copy link

codecov bot commented Mar 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 59.57%. Comparing base (6ddc2b4) to head (495d948).
⚠️ Report is 895 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #5162       +/-   ##
===========================================
+ Coverage   47.24%   59.57%   +12.33%     
===========================================
  Files         476      580      +104     
  Lines       46892    63257    +16365     
===========================================
+ Hits        22154    37688    +15534     
- Misses      24738    25569      +831     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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! I just have a couple of nitpicks

@github-actions
Copy link

Test262 conformance changes

Test result main count PR count difference
Total 52,963 52,963 0
Passed 50,079 50,079 0
Ignored 2,072 2,072 0
Failed 812 812 0
Panics 0 0 0
Conformance 94.55% 94.55% 0.00%

Tested main commit: c9aaad16b19aa2cadf72838fe8acc1043013023c
Tested PR commit: 495d948fd3881052eb332f6bb865ea1fbc31d5bf
Compare commits: c9aaad1...495d948

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 great!

@jedel1043 jedel1043 added the A-Bug Something isn't working label Mar 19, 2026
@jedel1043 jedel1043 enabled auto-merge March 19, 2026 15:56
@Monti-27
Copy link
Contributor Author

Looks great!

thanks mentor !!

@jedel1043 jedel1043 added this pull request to the merge queue Mar 19, 2026
Merged via the queue into boa-dev:main with commit d2d29a8 Mar 19, 2026
22 checks passed
@github-actions github-actions bot removed the Waiting On Review Waiting on reviews from the maintainers label Mar 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Bug Something isn't working C-Builtins PRs and Issues related to builtins/intrinsics C-Runtime Issues and PRs related to Boa's runtime features C-Tests Issues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TextDecoder constructor does not normalize encoding labels

2 participants