Skip to content

fix: TypedArray offset and length not respected by TextDecoder#4763

Merged
jedel1043 merged 4 commits intoboa-dev:mainfrom
zhuzhu81998:zhuzhu/typed-array-view-textdecoder
Feb 28, 2026
Merged

fix: TypedArray offset and length not respected by TextDecoder#4763
jedel1043 merged 4 commits intoboa-dev:mainfrom
zhuzhu81998:zhuzhu/typed-array-view-textdecoder

Conversation

@zhuzhu81998
Copy link
Contributor

@zhuzhu81998 zhuzhu81998 commented Feb 28, 2026

Closes #4615 .
Started because #4637 was closed without merging by the author while it had conflicts due to changes on the main branch from #4670 (let me know in case it was not intended to be closed).

Compared to previous PRs on this matter including #4637, this PR avoids allocating unnecessarily.

@github-actions
Copy link

Test262 conformance changes

Test result main count PR count difference
Total 52,862 52,862 0
Passed 49,505 49,505 0
Ignored 2,261 2,261 0
Failed 1,096 1,096 0
Panics 0 0 0
Conformance 93.65% 93.65% 0.00%

@codecov
Copy link

codecov bot commented Feb 28, 2026

Codecov Report

❌ Patch coverage is 90.90909% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 57.22%. Comparing base (6ddc2b4) to head (a67feac).
⚠️ Report is 709 commits behind head on main.

Files with missing lines Patch % Lines
core/runtime/src/text/mod.rs 90.90% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4763      +/-   ##
==========================================
+ Coverage   47.24%   57.22%   +9.97%     
==========================================
  Files         476      553      +77     
  Lines       46892    60618   +13726     
==========================================
+ Hits        22154    34686   +12532     
- Misses      24738    25932    +1194     

☔ 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.

@nekevss nekevss added the runtime Issues and PRs related to Boa's runtime features label Feb 28, 2026
@zhuzhu81998 zhuzhu81998 marked this pull request as ready for review February 28, 2026 20:48
@zhuzhu81998 zhuzhu81998 requested a review from a team as a code owner February 28, 2026 20:48
@zhuzhu81998
Copy link
Contributor Author

hard to believe there is no test262 for this 🤔

@jedel1043
Copy link
Member

jedel1043 commented Feb 28, 2026

That's because TextDecoder is not part of ECMA262; it is from a separate spec (https://encoding.spec.whatwg.org/). We kinda have tests for it in https://github.com/boa-dev/boa/tree/201418a5e1506ad098522be8d308bfbea80e495a/tests/wpt, but the repo download is kinda massive so we don't run it on our CI, and IIRC we would also need to enable the tests for TextDecoder

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.

Cool, no idea why the original PR was closed but avoiding allocations seems better overall

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.

Don't have any other comments then. We should try to fix the index inconsistency problem in a separate PR

@jedel1043 jedel1043 added this pull request to the merge queue Feb 28, 2026
Merged via the queue into boa-dev:main with commit 5026a5f Feb 28, 2026
19 checks passed
ashddev pushed a commit to ashddev/boa that referenced this pull request Mar 2, 2026
…oa-dev#4763)

Closes boa-dev#4615 . 
Started because boa-dev#4637 was closed without merging by the author while it
had conflicts due to changes on the main branch from boa-dev#4670 (let me know
in case it was not intended to be closed).

Compared to previous PRs on this matter including boa-dev#4637, this PR avoids
allocating unnecessarily.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

runtime Issues and PRs related to Boa's runtime features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TextDecoder returns irrelevant underlying buffer data

3 participants